π Multi-ReferenceLatent
One node for all your Flux reference images
- positive
- negative
- vae
- image1
- positive
- negative
If you've built a Flux workflow that takes a reference image - Kontext, Fill with a face swap, Redux-style conditioning - you know the ritual: VAE Encode the image, then a ReferenceLatent node, then another one for the negative side, and if you want two reference images it's double the wiring. This node deletes that whole chain. Feed it your conditionings, a VAE, and one or more images, and it VAE-encodes each one and appends it as a reference_latent to both positive and negative conditioning. Done.
It's the kind of node that doesn't look impressive until you open someone's FaceSwap-style workflow and see eight nodes collapsed into one. The pack's own flagship YarvixPA - Flux2 9B KV - GGUF example wires it straight in.
How it works
The mechanism is exactly what the node description promises: it replaces chained VAE Encode + ReferenceLatent nodes. For every connected image it:
- Encodes the image with your VAE into latent space.
- Appends that latent to the positive conditioning's
reference_latents. - Appends the same latent to the negative conditioning's
reference_latents.
Because it appends (rather than overwrites), multiple images stack up in the conditioning - that's what lets a single pair of conditioning outputs carry several references. The VAE you plug in matters: it should be the same VAE the model family expects, which with Flux means the standard Flux VAE from the model's own folder.
The references widget (1β16) doesn't create images, it exposes input slots. Bump it to 3 and the companion JS extension adds image2 and image3 inputs on the node; drop it back and the surplus slots vanish. image1 is always there and is the only one in the node's static schema - the rest are dynamically managed.
Inputs and outputs that matter
The few you actually set:
- positive / negative - your existing text conditioning (CLIPTextEncode output). Both get the reference latents attached.
- vae - the VAE used to encode the reference images.
- references - how many image inputs to expose (1β16).
- image1 β¦ imageN - the reference images themselves.
Outputs are the modified positive and negative conditioning, which go straight into your sampler. The node returns both, so you can keep the negative side lean by leaving its image slots empty - it skips any input that isn't wired.
Install
It ships in the ComfyUI-YarvixPA pack, by the YarvixPA account you may know from the FLUX.1-Fill-dev GGUF on HuggingFace. Install via ComfyUI Manager (search "YarvixPA") or:
cd ComfyUI/custom_nodes
git clone https://github.com/YarvixPA/ComfyUI-YarvixPA
Then restart ComfyUI. The pack's requirements.txt pulls opencv-python, numpy, Pillow and timm (plus a few leftover svg/reportlab entries nothing in the code imports); Manager handles those automatically.
Gotchas
The classic trap: setting references to 4 and only wiring two images. The node skips unwired slots silently, which is usually what you want - but if you intended to use three references and one wire is dangling, the conditioning silently carries two. Check the wire before blaming the result.
Also worth knowing: this node is specifically for models that consume reference_latents - the Flux Kontext / Fill / Flux 2 family and Redux-style conditioning. It does not magically give reference-image support to a plain Flux dev checkpoint that doesn't read that key. If the sampler ignores the references, the model doesn't support them, not the node's fault.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | Positive conditioning to modify with reference latents. | |
| negative | CONDITIONING | Negative conditioning to modify with reference latents. | |
| vae | VAE | VAE model used to encode the reference images into latent space. | |
| references | INT | 11β16 | Number of reference image inputs to expose. |
| image1 | IMAGE | Reference image 1. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | β |
| negative | CONDITIONING | β |