Reference Apply ๐
The old reference-only ControlNet trick, reimplemented as a model patch
- model
- MODEL
Before IP-Adapter, before edit models like Qwen-Image-Edit, there was reference-only ControlNet - a trick that isn't actually a ControlNet at all, since it has no conditioning image to extract spatial features from. Instead it feeds the network its own reference image's self-attention keys and values, so the generation "looks at" the reference while it denoises, without training anything and without a separate adapter model. Reference Apply is cgem156's own reimplementation of that idea, but as a model patch you wire directly rather than an image-based preprocessor.
The knowledge base's own read on this technique's current standing is honest about where it sits: it's legacy, superseded first by IP-Adapter and now by instruction-editing models for most character-consistency work, but it's "far from gone" - it still works, needs no training, and needs no extra model download. That's the case for reaching for it: you want a zero-training way to nudge generation toward a reference's look, purely at the model-patching level, without pulling in IP-Adapter's checkpoint or routing through an edit model.
How it's wired differently from the classic version
The original reference-only ControlNet takes a separate reference image. This node doesn't - it expects your reference to already be sitting inside your latent batch, at a specific batch position. index picks which batch item is the reference; during sampling, the model patch shares that item's self-attention with the rest of the batch. That means Reference Apply needs a batch built for it - see MultipleReferenceLatent in this same pack, which is the node that stamps a reference latent into specific batch indices for exactly this purpose.
The inputs that matter
modelin,MODELout - a patch, wire it before your sampler same as any model-patching node.index- which batch position holds the reference latent.mode- a combo defaulting toconcat; the schema doesn't expose what other modes exist, so treatconcatas the documented, known-working choice.depth(-1 to 12, default 12) - how many of the UNet's attention block depths get the patch. Default 12 applies it at every depth; dial it down if you want a lighter touch.start_step/end_step(0โ1, default 0/1) - windows the effect to part of the sampling schedule, the same idea as a ControlNet's start/end percent.apply_input/apply_middle/apply_output(all default true) - toggle whether the patch touches the UNet's input (down), middle, and output (up) blocks respectively.
Installing it
Via ComfyUI Manager: search cgem156-ComfyUI, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/laksjdjf/cgem156-ComfyUI
Restart afterward. No model downloads - this is a pure attention patch, nothing to fetch.
Common issues & troubleshooting
Nothing changes. First check the reference latent actually landed at the batch index you gave - MultipleReferenceLatent is the node responsible for putting it there; if your batch was built manually instead, index needs to point at wherever the reference actually is. Also confirm none of apply_input/apply_middle/apply_output got accidentally switched off.
The effect only shows up partway through generation, or not at all until late. Check start_step/end_step - a narrow window means the patch is only active for part of the trajectory.
Sparse documentation, unpredictable results by feel. This node isn't in the pack's own README feature table - it's a quieter corner than the pack's better-known tools, so expect to experiment rather than find a settings guide. That's consistent with the technique's own standing: it's a legacy trick that still works, not one that gets fresh community writeups in 2026.
You actually want multiple references at once. This node handles one reference index. For more than one, see MultipleReferenceApply in the same pack.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | โ | |
| index | INT | 00โ256 | โ |
| mode | COMBO | concat | 2 options: concat, replace |
| depth | INT | 12-1โ12 | โ |
| start_step | FLOAT | 0.000โ1 | โ |
| end_step | FLOAT | 1.000โ1 | โ |
| apply_input | BOOLEAN | true | โ |
| apply_middle | BOOLEAN | true | โ |
| apply_output | BOOLEAN | true | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | โ |