Reference Image
The node that hands your edit model a reference image
- conditioning
- image
- vae
- conditioning
- latent
If you've ever loaded an edit-model workflow and wondered how the input image gets from the Load Image node into the sampler, this is the node doing that job. "Reference Image" takes your conditioning, your image, and a VAE, and produces the guiding latent an edit model denoises against - the thing that tells the model "start from this picture, not from noise." It's from the Sage Utils pack, the same suite that does the metadata and LoRA-stack work, and it sits in the Sage Utils/clip/encode/image category because it's part of the image-edit conditioning pipeline.
How it works
Under the hood it's two core nodes stitched together into a subgraph: a VAEEncode (pixels + VAE → latent) and a ReferenceLatent (conditioning + latent → conditioning with the reference latent attached). The pack builds that graph for you when the node runs, which means you get the wiring for free and the node stays tiny. What comes out is the conditioning with the image embedded as the model's starting point, plus the raw encoded latent as a separate output if you want it.
The key phrase in the node's own description is "for an edit model." Not every checkpoint accepts a reference latent - you want one from the Qwen-Image-Edit line (or a similar image-editing architecture that expects a guiding image), not a plain text-to-image model. If the model supports it, you can also chain several of these together to set multiple reference images, each one layering another latent into the conditioning. That's the party trick: multiple references, one conditioning stream.
The inputs that matter
- conditioning - your text conditioning, usually straight from a CLIP encode node. This is the thing the reference latent gets attached to.
- image - the reference image itself.
- vae - the VAE for encoding that image. Use the VAE that matches your checkpoint; mixing a mismatched VAE in here is the classic way to get a garbled edit.
It outputs conditioning (feed it into your KSampler) and latent (the encoded image, handy if you also want to do img2img on the same frame or inspect the latent).
Installing it
Sage Utils installs like any custom node - easiest via ComfyUI Manager by searching for Sage Utils - or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils
cd ComfyUI_SageUtils
pip install -r requirements.txt
Restart ComfyUI and you're done. The pack's only Python dependency is dynamicprompts, and nothing here needs a model download - the LLM chat tab and other extras in the pack are optional and unrelated to this node.
Where people get burned
The most common failure is wiring this into a model that doesn't support reference latents. Nothing crashes - you'll just get output that ignores the image or looks wrong. Check your checkpoint's documentation before assuming it's an edit model. Second: use the matching VAE. A mismatched VAE produces an encoded latent that decodes into noise, and it'll look like the node is broken when the problem is upstream. And if you're chaining multiple reference images, only do it when your model actually advertises multi-reference support - otherwise each extra ReferenceLatent is just eating your conditioning budget for nothing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | The input conditioning. | |
| image | IMAGE | The reference image. | |
| vae | VAE | The VAE model for encoding the image. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | The output conditioning. |
| latent | LATENT | The encoded latent. |