Reference Preproccessor ππ π π
Prep an image for ControlNet Reference in ComfyUI
- image
- vae
- latent_size
- proc_IMAGE
ControlNet Reference is the odd one out in the ControlNet family: there's no separate model file and no edge/depth/pose preprocessor. You hand it a raw image and it steers generation using that image's own self-attention features - closer in spirit to IP-Adapter than to canny, but living inside the ControlNet framework. This node is the small but necessary prep step that gets your reference image into the form Reference mode expects.
Specifically, it VAE-encodes your reference image and shapes it to match your latent, producing a processed image you then feed into the Reference ControlNet path. Reference guidance operates in latent space, so the raw pixels have to be encoded first - that's the job here.
Where Reference fits
Per the ControlNet KB, Reference is one of the great SD 1.5 / SDXL exclusives - it was never rebuilt for the post-Flux DiT bases. If you want it, you're on SD 1.5 or SDXL, and honestly that's still where it lives happily. The classic use is style and character consistency: combine Reference with lineart and you've got the 2023-era recipe for keeping an AI character looking like itself across scenes, without training a LoRA. The README notes Reference supports reference_attn, reference_adain, and reference_adain+attn modes, with style_fidelity and ref_weight matching Auto1111's style_fidelity and control_weight - but those knobs live on the apply/model side; this node just does the encoding.
Inputs and outputs
All three inputs are required and all three matter:
- image - your reference image (the look/style/subject you want echoed). Raw pixels are fine; this node handles the encoding.
- vae - the VAE used to encode it. Use the VAE that matches your checkpoint, or you'll get a color/space mismatch.
- latent_size - a latent whose dimensions the processed reference is matched to. Wire in an Empty Latent (or your working latent) at the resolution you're generating so the reference lines up.
Output: proc_IMAGE - the processed reference, ready to flow into the Reference ControlNet path (the image input on Apply Advanced ControlNet, with a Reference ControlNet in the graph).
Installing the pack
ComfyUI Manager β Install Custom Nodes β search "ComfyUI-Advanced-ControlNet" β restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet, then restart. No heavy dependencies - it's pure ComfyUI, from Kosinkadink (the AnimateDiff-Evolved dev). Reference doesn't need a downloaded ControlNet model file the way canny or depth does, which is part of the appeal; the "model" is your reference image itself.
Common gotchas
The VAE mismatch is the classic one. Feed an SDXL VAE with an SD 1.5 pipeline (or vice versa) and the encoded reference comes out wrong - washed out, off-color, or just ineffective. Match the VAE to your checkpoint.
Second, the latent_size input trips people because it's easy to forget it's driving resolution matching. If your reference influence looks stretched or misaligned, check that the latent you connected is the resolution you're actually generating at.
Finally, remember Reference is SD 1.5 / SDXL only. There's no Flux, Qwen-Image, or Z-Image equivalent - the KB is explicit that Reference (like QR-code conditioning) was never ported to the modern bases. If you're on a newer architecture and reaching for this node, you're on the wrong model for the job; do the reference pass on SDXL and carry the result forward.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| vae | VAE | β | |
| latent_size | LATENT | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| proc_IMAGE | IMAGE | β |