Conversation
When passing comma-separated seeds (e.g., "1024,2048") with batch_size > 1, parser.int() was silently converting the string to the default value (-1), breaking deterministic multi-seed batch generation. Changed seed parameter from parser.int() to parser.get() to preserve the raw value (string or int). Downstream code in prepare_seeds() already handles both formats correctly. Fixes #782 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChanged seed field retrieval in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #782
Summary
This PR fixes a bug where multi-seed batching was silently broken in the FastAPI server. When users provided comma-separated seeds (e.g.,
seed="1024,2048") withbatch_size > 1, only the first sample remained deterministic due to incorrect parameter parsing.Problem
The FastAPI request builder in
acestep/api/http/release_task_request_builder.pywas usingparser.int("seed", -1)which attempted to convert comma-separated seed strings like"1024,2048"into an integer. This conversion silently failed and returned the default value-1, breaking the multi-seed feature.Solution
Changed line 57 from:
To:
This preserves the raw seed value (whether string or int), allowing downstream code to parse it correctly.
Why This Works
The downstream
prepare_seeds()function inacestep/core/generation/handler/task_utils.pyalready handles:"1024,2048"→ parsed as list1024→ treated as single seed-1orNone→ generates random seedsThe multi-seed pipeline was fully functional end-to-end, but the API request builder was breaking the chain by forcing int conversion.
Testing
Before fix: All batch samples got seed=-1 (non-deterministic)
After fix: Each sample gets its specified seed
Test command:
Expected: Three deterministic outputs with different seeds.
Impact
Checklist
Summary by CodeRabbit