Repository navigation
feat(flux3): run the prompt upsampler inside FLUX.3 generations - #10219
Open
Pfannkuchensack wants to merge 2 commits into
Open
Pfannkuchensack wants to merge 2 commits into
Pfannkuchensack wants to merge 2 commits into
Conversation
A Prompt upsampler switch adds a node that rewrites the prompt with BFL's upsampler, which reads the reference images and Regional Guidance boxes; the caption is saved as flux3_caption and recall restores switch and model. Expand Prompt ships BFL's t2i system prompt as "FLUX.3 Prompt Upsampler" and preselects it for FLUX.3 models.
Member
Author
joshistoast
requested changes
Nov 10, 2026
…n load it A Prompt Upsampler pick that was no longer installed kept blocking Invoke after the switch was turned off. Slots behind a switch (prompt upsampler, the two PiD slots, Anima's inpaint adapter) now declare when their selection is in use, and the installed-model check skips a selection nothing loads; turning the switch on asks for it again.
joshistoast
approved these changes
Nov 10, 2026
This branch has not been deployed
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
FLUX.3's prompt upsampler could only be reached through Expand Prompt, with a system prompt pasted by hand, and never
saw the reference images an edit needs. A FLUX.3 generation can now run it itself.
under Components, required while the switch is on.
flux3_prompt_upsamplerrewrites the prompt into the caption the text encoderencodes. It reads the reference images (an edit) and the Regional Guidance boxes (a layout) and uses the matching
one of Black Forest Labs' four system prompts. It takes the place of the layout prompt node: ids and boxes of the
regions, and of a box table typed at the end of the prompt, are kept exactly.
flux3_captionand the model asflux3_prompt_upsampler. Recall restores the typed prompt,the switch and the model; a FLUX.3 image made without the upsampler turns the switch off.
t2isystem prompt as FLUX.3 Prompt Upsampler and preselects it, with an installedupsampler, when a FLUX.3 model is selected.
The node follows diffusers'
upsample_prompt(greedy, no presence penalty) and reuses its system prompts, scaffolds,reference preparation and box-table reconciliation.
Related Issues / Discussions
Follow-up to #10092 (the upsampler as a Text LLM) and #10095 (FLUX.3 layout boxes).
QA Instructions
Automated
uv run --no-sync pytest tests/backend/flux3 tests/app/invocations/test_flux3_prompt_upsampler.py tests/app/invocations/test_flux3_nodes.py tests/app/invocations/test_node_discovery.py tests/app/invocations/test_frontend_flux3_layout_graphs.py tests/app/invocations/test_frontend_graph_node_types.py tests/app/services/shared/sqlite_migrator tests/backend/model_manager/test_starter_models.py tests/backend/model_manager/test_starter_models_package.py tests/app/routers/test_starter_model_is_installed.py: 1468 passed, 10 skipped.pnpm lintpasses; the touched unit and browser test files pass (graph,compileCanvasGraph,baseGenerationPolicies,settings,graphCoverage,imageRecall,GenerateSettingsForm.browser,ExpandPromptSuggestion.browser).test:performance:build,test:performance:browserandtest:project-files:browserpass.test:accessibility:browser: every journey passes except the last one,launchpad-hidden-maintenance, which timesout waiting for its dialog to close. It fails the same way on unchanged
main(83507c6) on this Windowsmachine; CI is green for that commit.
On an RTX 4090 (Windows), bf16 upsampler folder unless noted:
upsample_prompt, character for character, for a text prompt, one and two referenceimages, a layout with two regions, and a layout with one reference image and one region, when the reference process
ranks the SDPA kernels as InvokeAI does. Under torch's stock ranking the three image cases diverge after 15-110
tokens, in the reference itself as well.
without loading the model.
flux3_captionin the metadata equals the node output, boxesland where drawn.
Timings, medians of three runs after a warm-up, no other program computing on the GPU, FLUX.3 Klein bf16 at
1024 x 1024 and 16 steps:
max_cache_ram_gb: 24instead of 40In the browser against that server: the switch toggles by keyboard and carries its help text as description; the
slot shows "None" while the switch is off; with the switch on and no model the slot is marked invalid with its
reason and Invoke shows one issue; picking a model unblocks it; a generation runs the upsampler and records caption
and model; switching off keeps the pick; "Reuse from image > All settings" turns the switch on for an image made with
the upsampler and off for one made without, restoring the typed prompt both times; Expand Prompt preselects the
upsampler and the FLUX.3 Prompt Upsampler system prompt and rewrites the prompt.
With the picked upsampler unregistered through the API, the switch on shows "Invoke · 1 issue" with
"Prompt upsampler ... is not installed" and a Clear button; switching off removes the issue and Invoke is enabled;
switching on brings it back.
To try it: install FLUX.3 Prompt Upsampler (or the int8 starter) and a FLUX.3 model, turn on Prompt
upsampler in Render, pick the model under Components, add a reference image or Regional Guidance layers, and
generate. The encoded caption is in the image's metadata as
flux3_caption.Not verified: Regional Guidance with the upsampler through the Canvas UI (covered by the canvas compile tests,
the backend-validated snapshot graphs and API runs with regions); the model-family round trip in the browser (the
test install has only FLUX.3 models); ROCm, MPS and CPU. Family E2E has no FLUX.3 manifest.
Review
Resolved:
handling and in recall, and a kept pick that was no longer installed blocked Invoke in other model families. The
slot is now always part of FLUX.3's Components and required only while the switch is on.
compute_deviceinstead of the first parameter.spends its time copying a processor it does not test; restating and duplicate tests removed.
behind a switch now say when their selection is in use, and the installed-model check skips a selection nothing
loads: the prompt upsampler, the two PiD slots and Anima's inpaint adapter. Turning the switch on asks for the
model again.
Remaining limits:
of about 2.5 s per new prompt; on 24 GB it keeps the text encoder and transformer from sharing VRAM with it.
holds neither model set (32.1 GiB with the bf16 upsampler, 25.3 GiB with the int8 one), so models are read from
disk again for each new prompt until
max_cache_ram_gbis raised. Documented with the measured difference.modular_pipelines.flux3.prompt_upsampler, which is not a public API; the testsuse diffusers'
upsample_promptas their oracle and fail on a bump that changes it.Compatibility / Rollout
as it is.
flux3_prompt_upsampler;openapi.jsonandschema.tsare regenerated.defaults.
flux3_prompt_upsampler;flux3_captionis now also written whenever the upsampler ran.Checklist
What's Newcopy (if doing a release after this PR)Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.