Nodes/ComfyUI-Flux2Klein-Enhancer/Multi ReferenceLatent
ComfyUI Node

Multi ReferenceLatent

How you actually feed reference images into Klein

By capitan01R·Created 7 months ago·Updated 30 days ago· 551
Multi ReferenceLatent
  • conditioning
  • latent_1
  • latent_2
  • latent_3
  • latent_4
  • latent_5
  • latent_6
  • latent_7
  • latent_8
  • conditioning

This is the node that quietly makes every other node in the pack possible. It's not flashy - no strength sliders, no fancy modes - but if you're doing anything reference-based with FLUX.2 Klein through this pack, this is the thing that actually gets the reference images into the model in the first place.

What it does

Klein natively supports up to ten reference images, and it keeps their latents entirely separate from your text conditioning - appended as their own token sequence in the model's image stream, patchified independently, with an exact runtime token count (reference_image_num_tokens) the model tracks per reference. This node is what builds that structure: it takes up to eight VAE-encoded latents and packs them into your conditioning object as an indexed reference list, storing meta["reference_latents"] and meta["reference_latents_method"] = "index" under the hood.

It replaces the conditioning's existing reference list rather than appending to it - so if you chain two of these, the second one wins, not both.

The inputs and output

  • conditioning - your existing positive conditioning (from CLIP Text Encode, Sectioned Encoder, or anything downstream of those).
  • latent_1 - required. Your first reference, already VAE-encoded - not a raw image.
  • latent_2 through latent_8 - optional, same rule: encoded latents, not images. Reference order matters and is shared with every downstream masking node in the pack: latent_1 corresponds to subject_mask_1, latent_2 to subject_mask_2, and so on, all the way to 8.

There's no weighting, no append mode, no per-reference strength here - that control lives in the other nodes further down the chain (Ref Latent Controller, Ref Latent Weight, Mask Ref Controller). This node's whole job is getting the references in.

Output is a single conditioning - feed it straight to your sampler's positive input.

Installing it

ComfyUI Manager: search ComfyUI-Flux2Klein-Enhancer, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/capitan01R/ComfyUI-Flux2Klein-Enhancer.git

No extra Python packages required.

Where people get burned

The one thing worth repeating because it trips people up constantly: the inputs are latents, not images. VAE-encode every reference with the FLUX.2 VAE before it reaches this node. Wire an IMAGE output straight into latent_1 and you'll get a type-mismatch error at graph time, which at least fails loudly - the more subtle version of the same mistake is encoding with the wrong VAE and getting a reference that technically loads but doesn't influence the generation the way you expect.

Second: this node does not control your output resolution. The canvas size is still whatever latent you hand to the sampler, not the dimensions of your references. It's easy to assume a 1024×1024 reference means a 1024×1024 output - it doesn't, and the two are unrelated unless you set them that way yourself.

Third, if you're layering identity-transfer or masking nodes on top of this (Identity Feature Transfer Final, Mask Ref Controller, Ref Latent Controller), remember the reference order set here is the order every one of those nodes assumes. Reordering your latent inputs later without updating your masks elsewhere in the graph is a quiet way to attach the wrong mask to the wrong subject.

Categoryconditioning/flux2klein

Inputs (9)

NameTypeDefaultDescription
conditioningCONDITIONING
latent_1LATENT
latent_2optLATENT
latent_3optLATENT
latent_4optLATENT
latent_5optLATENT
latent_6optLATENT
latent_7optLATENT
latent_8optLATENT

Outputs (1)

NameTypeDescription
conditioningCONDITIONING