Nodes/ComfyUI-Flux2Klein-Conditioning-Toolkit/FLUX.2 Klein Prompt/Reference Balance
ComfyUI Node

FLUX.2 Klein Prompt/Reference Balance

Prompt or reference?

By xmarre·Created 6 months ago·Updated 5 months ago· 10
FLUX.2 Klein Prompt/Reference Balance
  • conditioning
  • CONDITIONING
balance0.50
replace_modezeros
skip_bostrue
active_end_override0
target_reference_index-1
debugfalse

Every Klein edit is a tug-of-war. The text conditioning wants to push you toward what you typed; the reference latent wants to drag you back toward the source image. This node is a single slider for that fight: FLUX.2 Klein Prompt/Reference Balance.

It's the convenience wrapper of the pack - the one you reach for when you're prototyping and don't want to babysit two or three separate knobs. It takes one balance value (0–1) and translates it into both a text gain and a reference weakening in one pass:

  • balance = 0.0 - mute the prompt text, keep the full reference. Pure "keep the source" mode.
  • balance = 0.5 - keep both at full strength. The neutral middle.
  • balance = 1.0 - full prompt text, reference driven to minimum. "Do what I say" mode.

The math underneath is straightforward: on the lower half, text gain rises linearly from 0 to 1 while the reference stays untouched; on the upper half, the text stays at full gain while reference_keep falls from 1 toward 0. So the slider is smooth and predictable - slide left to stay faithful to the source, slide right to obey the prompt.

The caveat that will bite you

The reference side is implemented via reference mixing, not raw scaling - the same replace_mode choices as the Reference Latent Mixer (zeros, gaussian_noise, channel_mean, lowpass_reference). That means balance = 1.0 is only a true "reference off" endpoint when replace_mode is zeros.

If you leave it on lowpass_reference, the "weakened" path still keeps a blurred coarse version of the reference - broad color, illumination, some channel statistics. That's a feature when you want to loosen detail lock without discarding appearance, and a trap when you expect the slider to fully kill the reference. The README is explicit about this: use lowpass_reference when you want the color to survive, not when you want reference influence gone. Want a hard off switch? zeros.

The other inputs are the same supporting cast as the rest of the pack: skip_bos (True by default), active_end_override for when the attention mask is missing, and target_reference_index (-1 = all references). Output is a single CONDITIONING.

How it plays with the other nodes

This node is a great place to start an edit session: find the balance you want with one slider, then swap in the finer tools when you hit the limit of a single number. Text still not obeying at balance = 1.0? That's the Conditioning Enhancer's magnitude / edit_text_weight talking. Reference still too clingy? The Reference Latent Mixer's reference_keep and spatial_fade refine what this slider can only crudely sweep. Colors washed out after all that? The Reference Appearance Balancer. They all operate on the same conditioning metadata, so chaining them in any order works.

Install

Same pack, same one-time install. ComfyUI Manager search "Flux2Klein", or:

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-Flux2Klein-Conditioning-Toolkit

Restart. No model downloads, no dependencies beyond torch.

The usual positioning rule applies: it must sit after whatever node injects the reference latents and before the sampler. And if you toggle balance and absolutely nothing changes, check that your conditioning actually carries the reference_latents metadata - without a reference path there's nothing for the slider's reference half to act on, and with no reference the text half is already at your prompt's natural strength.

Categoryconditioning/flux2klein

Inputs (7)

NameTypeDefaultDescription
conditioningCONDITIONING
balanceFLOAT0.500–1
replace_modeoptCOMBOzeros4 options: zeros, gaussian_noise, channel_mean, lowpass_reference
skip_bosoptBOOLEANtrue
active_end_overrideoptINT00–512
target_reference_indexoptINT-1-1–64
debugoptBOOLEANfalse

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING