Nodes/ComfyUI-ADIC/参考潜变量
ComfyUI Node

参考潜变量

Give an edit model its guiding image — in latent form

By jinchanz·Created about a year ago·Updated a day ago· 5
参考潜变量
  • conditioning
  • latent
  • CONDITIONING

Some edit models don't want to see a reference image as pixels - they want it baked into the conditioning as a latent. MaletteReferenceLatent is the node that does that wiring. The author's own description is the spec: "This node sets the guiding latent for an edit model. If the model supports it you can chain multiple to set multiple reference images."

Mechanically it's a thin wrapper over ComfyUI's standard conditioning trick. It takes a CONDITIONING input, and if you've given it a latent, it appends reference_latents to the conditioning's dictionary - {"reference_latents": [latent["samples"]]} - using append mode, not overwrite. That last detail is the whole point of the "chain multiple" claim: because each call appends rather than replaces, you can stack several of these nodes in a row, each adding another reference latent, and a model that supports multiple references will receive all of them.

The node is deliberately forgiving: if latent is left unconnected (it's optional), the conditioning passes through untouched - which makes it safe to drop into a workflow and populate later.

Inputs and output

  • conditioning - required, the conditioning block you're augmenting.
  • latent - optional; the reference latent to attach. Leave empty for a pass-through.
  • Output: CONDITIONING, the same block with reference_latents appended.

Where this fits - and where it doesn't

This is aimed at "edit models" that read a reference_latents key from conditioning - the family that includes the FLUX.1 Kontext-era editing approach. Kontext itself, the model that kicked off instruction-style editing in 2025 (reference images concatenated into the context window), works through a reference image pathway in most ComfyUI workflows rather than raw latent injection, so if you're on a standard Kontext workflow you may never need this node - the reference image path is the well-trodden one. This latent pathway is for the more specialized edit models that expect it.

And a fair warning, the same one that applies to Kontext generally: by 2026 the editing crown moved to FLUX.2 Klein and Qwen-Image-Edit, and Kontext's non-commercial license kept NSFW derivatives a violation. If your workflow's edit model doesn't actually document a reference_latents mechanism, this node will attach a key nobody reads and quietly do nothing - so check your model's conditioning expectations first.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/jinchanz/ComfyUI-ADIC

Restart ComfyUI, or install "ComfyUI-ADIC" via ComfyUI Manager. No extra dependencies, no model downloads - the conditioning helper is a few lines of Python. The pack README doesn't document it (Chinese, translate-node-focused), so the source (module/nodes_image_utils.py) is the reference.

Categoryadvanced/conditioning/edit_models

Inputs (2)

NameTypeDefaultDescription
conditioningCONDITIONING
latentoptLATENT

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING