fix: route around stuck flux-schnell, bound latency, tame hands#73
Merged
Conversation
|
🚅 Deployed to the breadcrumbs-pr-73 environment in Breadcrumbs
|
…hands Replicate's canonical `black-forest-labs/flux-schnell` model has been accepting predictions but never scheduling them, leaving generate-image requests hanging indefinitely (no timeout on replicate.run, so uvicorn workers stalled and the browser spun forever). The sibling `flux-schnell-lora` runs the same weights on a different pool and works — but OOMs at num_outputs>1, so we now fan out one single-output prediction per candidate, in parallel, with a 60s per-call timeout. Any single failure now costs one of four candidates instead of the whole batch. Also tightened the style suffix: hands must rest calmly, be folded, or hold a single object — never reaching, gesturing, or pointing. Flux ignores negative prompts but responds well to positive anatomical framing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1b5bbf1 to
5ff4439
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
black-forest-labs/flux-schnellmodel has been accepting predictions but never scheduling them. With no timeout onreplicate.run, the FastAPI request hung forever — browser spinner stuck on "Generating...", no error ever surfaced. Confirmed by inspecting prod predictions: six were stuck instartingstate with nostarted_at(oldest 3+ hours old); siblingflux-schnell-lorasucceeded on the same account in 0.6s.flux-schnell-lora(same Flux Schnell weights, different worker pool). It OOMs atnum_outputs>1, so we now fan out one single-output prediction per candidate, in parallel, with a 60s hard timeout each. Any single failure now costs one of four candidates, never the whole batch — and a fully degraded upstream errors out in 60s instead of hanging forever.Test plan
uv run pytest tests/test_images.py— 38/38 pass (added partial-failure test and timeout test)uv run pytest— full suite 177/177 pass🤖 Generated with Claude Code