Nodes/ComfyUI_LC123_nodes/LC Reference Latent
ComfyUI Node

LC Reference Latent

Hand FLUX.2 Klein up to eight reference images at once

By lonecatone23·Created 2 months ago·Updated about 12 hours ago· 19
LC Reference Latent
  • conditioning
  • latent_1
  • latent_2
  • latent_3
  • latent_4
  • latent_5
  • latent_6
  • latent_7
  • latent_8
  • conditioning

If you've seen FLUX.2 Klein workflows, you know the trick: Klein can take reference images alongside your text prompt to hold a subject's identity - same person across shots, same character across a scene. The fiddly part is plumbing those VAE-encoded references into the conditioning. LC Reference Latent is the plumbing, built to handle up to eight of them without making your graph look like a rat's nest.

You take a text conditioning from your normal CLIP encode, drop in up to eight VAE-encoded LATENT slots, and the node attaches them to the conditioning's metadata using what the author calls the Klein index method (reference_latents with method index). One conditioning socket in, one out, and it now carries both your prompt and your references.

How it works

The important design decision is that every reference slot is optional. Each latent_1 through latent_8 input is validated - if it's unconnected, or connected to something that isn't a proper 4-D latent tensor, that slot is silently skipped. If none of them are valid, the conditioning passes through completely unchanged. That's what makes it bypasser-safe: you can leave the node in a graph with everything disconnected and it behaves as a wire. Klein wants the references in order, so the node preserves slot order when it builds the list.

What you actually set

  • conditioning - the text conditioning you want the references attached to (required).
  • latent_1 … latent_8 - optional. Each is a VAE-encoded image: Load Image → VAE Encode, or the latent straight from another branch.

Output is a single conditioning. Then it's the same downstream path as any conditioning - into a KSampler, or into a Klein-aware sampler that understands the reference metadata.

Context and honest caveats

This node only means something on a workflow that knows how to read reference_latents - i.e. FLUX.2 Klein multi-reference generation. On a plain SDXL or even a vanilla Flux setup it does literally nothing except pass the conditioning through, which is safe but pointless. Klein is a flow-matching, guidance-distilled model (see the KB's concepts doc for its CFG/step expectations), so don't bolt this onto an unrelated pipeline and expect magic.

Install

It's part of the LC123 pack: ComfyUI Manager → search "LC123", or

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes

Restart, and you're set. No extra pip packages - the pack runs on ComfyUI's own torch/numpy. Cloud-hosted ComfyUI (RunningHub etc.) won't have LC123 until you request it, so shared Klein workflows using this node need a local install or a pack request.

CategoryLC123/conditioning

Inputs (9)

NameTypeDefaultDescription
conditioningCONDITIONINGText conditioning to attach reference latents to.
latent_1optLATENTOptional reference latent 1. Unconnected or invalid slots are ignored.
latent_2optLATENTOptional reference latent 2. Unconnected or invalid slots are ignored.
latent_3optLATENTOptional reference latent 3. Unconnected or invalid slots are ignored.
latent_4optLATENTOptional reference latent 4. Unconnected or invalid slots are ignored.
latent_5optLATENTOptional reference latent 5. Unconnected or invalid slots are ignored.
latent_6optLATENTOptional reference latent 6. Unconnected or invalid slots are ignored.
latent_7optLATENTOptional reference latent 7. Unconnected or invalid slots are ignored.
latent_8optLATENTOptional reference latent 8. Unconnected or invalid slots are ignored.

Outputs (1)

NameTypeDescription
conditioningCONDITIONING