Flux Text/Ref Balance ⚡
One dial to trade prompt vs. reference — the pack's best idea
- model
- conditioning
- MODEL
- CONDITIONING
The eternal reference-conditioning complaint, in one sentence: "I want the model to keep the person but do what the prompt says." Flux Text/Ref Balance is a single dial that trades prompt strength against reference-image strength - 0.0 is text only, 1.0 is reference only, 0.5 leaves both alone. It's the cleanest idea in the whole ComfyUI-Flux-Reference-Tools pack, and it's probably the first node you should play with after you get a reference chain running.
Everything else in the pack makes you think in terms of specific references and spatial fades. This one answers the classic edit-model tension directly: when you push an edit too hard, the image stops listening to your prompt; when you back off, the subject drifts. One slider, and you're scanning that trade-off curve instead of juggling three multipliers.
How it works
It clones your model and installs an attention patch (the same set_model_attn1_patch the whole pack uses, firing on every Flux attention block). The patch scales two groups of K/V tokens in opposite directions:
- the text tokens - the prompt's part of the sequence, found via
img_slicein comfy'sextra_options - the reference tokens - the trailing reference-image tokens, sized from
reference_image_num_tokens
Below 0.5, the text side scales down (text_scale = balance * 2) while the reference side stays at 1.0. Above 0.5, it flips: the reference scales down (ref_scale = (1 - balance) * 2) and the text stays full. At 0.5 neither moves. Because it works purely on attention K/V, it applies across the whole Flux family - Flux.1, Kontext, Klein - with zero model-specific logic.
The inputs that matter
- balance (default 0.5, range 0–1, step 0.001) - the whole node. That fine a step exists because the interesting region - 0.3 to 0.7 - is where the output flips character noticeably.
- conditioning - passed through untouched; it's there so the node can confirm there's a reference setup to balance against, and so you can thread it forward.
Outputs are MODEL and CONDITIONING. The model goes into your KSampler; the conditioning continues down the graph.
Where it sits in the workflow
After the reference-attachment node, upstream of the KSampler, alongside (or instead of) the per-reference controllers. Natural pairing: Flux Ref Latent Controller handles which reference matters, Flux Text/Ref Balance handles how the whole reference block compares to your words. Set a starting balance of 0.5, run, and nudge toward the reference side when the prompt is winning and the subject drifts, or toward text when the edit is drowning the prompt.
Install
Identical to the rest of the pack - nothing extra to download, no models, no keys:
cd ComfyUI/custom_nodes
git clone https://github.com/ChrisColeTech/ComfyUI-Flux-Reference-Tools
Restart, search "Flux Text/Ref Balance" under 🤖 CCTech/Flux Reference, or use ComfyUI Manager.
Common issues
- The dial appears to do nothing. Two usual suspects: your reference latents never made it into conditioning (check the attachment node), or the model isn't a Flux-family checkpoint - the attention patch only fires on comfy's Flux attention blocks, which is the entire family this pack targets.
- You can't get the prompt fully back. Balance 0 leaves text unscaled, but the reference is still in the sequence - 0.0 makes text win, it doesn't delete the reference. If you want a reference completely gone, silence it at the attachment/controller level instead.
- Feels non-linear. The text and reference scales move linearly, but the output doesn't feel linear - most of the visible action is between 0.4 and 0.6. That's expected; treat the dial as a curve you're scanning, not a volume knob.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| conditioning | CONDITIONING | — | |
| balance | FLOAT | 0.5000–1 | — |
| debugopt | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CONDITIONING | CONDITIONING | — |