Reference Chain Conditioning
Stop Chaining Reference Latents — This Node Does It in One Drop
- conditioning
- neg_conditioning
- vae
- image_input_1
- conditioning
- neg_conditioning
- first_image_scaled
Flux 2 Klein's whole selling point is multi-reference consistency: feed it up to ten images and it keeps the characters, objects, and style straight without a LoRA. The annoying part is ComfyUI's core interface for that - one Reference Latent node per image, chained end to end. Want five references? That's five nodes, five VAE encodes, five wires to keep straight. The author got sick of exactly that and vibe-coded this node, and honestly it fixes the right problem. It takes any number of images through a single drag-and-drop list, scales each, VAE-encodes it, and appends it to your conditioning in one pass.
It's a young, small pack (launched January 2026, MIT-licensed, no dependencies), so treat it as a convenience wrapper, not a black box. Which it genuinely is: the source is a straight loop over conditioning_set_values(cond, {"reference_latents": [latent]}, append=True) - the exact call ComfyUI's core Reference Latent node makes. You're getting the same math, just without the chain.
How it works
Each image in your list is loaded, rescaled to your target megapixels, VAE-encoded, and appended to the conditioning in order. Order matters - Klein reads the sequence, and prompts like "go wild with these images" lean on it. The same latents get appended to both the positive and negative conditioning, so your negative prompt doesn't accidentally fight the references. Images you wire in as node inputs are processed first, then the ones in the drop list, in the order you see them.
The inputs that matter
- conditioning - your prompt conditioning from the CLIP text encode node. This is where you "switch out the Reference Latent nodes" the author means: text encoder out goes here.
- neg_conditioning - also required, and the README undersells that. This bites everyone once: you'll get a "required input is missing" error if you only wire the positive side.
- vae - the edit model's own VAE. Klein wants its specific VAE, not an SDXL one.
- scale_megapixels (default 1.0) - target resolution, not a fixed WxH. The node rescales so width × height lands at roughly that many megapixels, which is why 1.0 is right for Klein. Crank it up only if you know the model wants more; you're paying in VRAM and encode time.
- upscale_method (default
lanczos) - the five usual suspects. Leave it alone unless you have a reason. - images - the actual hook. Click "choose file to upload" or drag images straight onto the node; they upload to your input folder and the node auto-sizes itself to fit the list. Each entry shows a preview, dimensions, and an X to remove it.
- image_input_node_count + the Update image inputs button - if you'd rather feed images from other nodes, set the count and hit the button to spawn
image_input_1,image_input_2, … IMAGE sockets.
Outputs: conditioning and neg_conditioning (both carrying every appended reference latent), plus first_image_scaled - a preview of the first image after scaling, handy for sanity-checking what the model actually sees.
Installing it
Easiest via ComfyUI Manager: search "ReferenceChain" and hit Install. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/remingtonspaz/ComfyUI-ReferenceChain.git
Restart ComfyUI after. That's it - no requirements.txt, no model downloads. It only uses numpy, torch, and Pillow, all bundled with ComfyUI. One pack gives you both nodes in this repo.
Common issues
- "Required input is missing" - it's
neg_conditioning, 90% of the time. Wire a text-encode negative output in. - No reference effect / flat output - if the images widget is empty or every file fails to load, the node falls back to a 1×1 black tensor and passes your conditioning through unchanged. Check the console for
[ReferenceChainConditioning] Warning: Image not found:lines; those filenames live in yourComfyUI/inputfolder and the node reads them at run time, so don't move or delete them. - This won't work with Qwen-Edit - the author confirmed it: Qwen uses its own text-encode node, not this
reference_latentsmechanism. Klein is the intended audience. - Not re-running after swapping an image - this node is actually good here: it hashes image file contents for its change detection, so editing a file on disk triggers a re-run. Most nodes won't bother.
Is it life-changing? No. But if you build Klein edit workflows more than once, it kills a genuinely fiddly wiring task, and it's free to try.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| neg_conditioning | CONDITIONING | — | |
| vae | VAE | — | |
| upscale_method | COMBO | lanczos | 5 options: nearest-exact, bilinear, area, bicubic, lanczos |
| scale_megapixels | FLOAT | 1.000.01–16 | — |
| images | STRING | [] | — |
| image_input_node_count | INT | 00–1000 | — |
| image_input_1opt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| neg_conditioning | CONDITIONING | — |
| first_image_scaled | IMAGE | — |