Krea2-UniDepth Apply References
Krea2 edit mode that never touches the model forward
- positive
- negative
- vae
- target_latent
- references
- positive
- negative
- target_latent
- prepared_references
- reference_count
Krea2-UniDepth Apply References is the edit half of the pack. Where the Conditioning node turns a depth map into a reference, this node does the same thing for one or more real images: VAE-encodes your reference stack at the exact target geometry and hands it to Krea2 through its native reference path. No wrapper, no replaced diffusion model, no approximation of what Krea2 already does. You keep a completely stock model forward and just add conditioning metadata.
The name is worth reading closely. This is not a "reference" node in the ControlNet sense of a second network steering the sampler. Krea2 natively supports reference latents - it's how the hosted product does style-reference - and this node simply speaks that protocol. Krea2 assigns frame 0 to your target tokens and positive frame indices to each reference, and the node decides how those tokens are presented to the model. That distinction is why it can be this small and still work.
The two modes that matter
The one setting beginners get wrong is reference_mode, and the README explains it cleanly:
depth / clean t=0- the reference is attached as clean timestep-zero tokens. This is for functional LoRAs trained with clean reference tokens, which is what the pack's own depth LoRA is.edit / shared timestep- the reference rides the live diffusion timestep. Use this when your edit LoRA was trained with its source reference sitting on the sampling timestep, which is the convention identity/edit LoRAs tend to use.
Pick the one that matches the LoRA you loaded, not the one that sounds cooler. If your edit comes out looking like the source was ignored, you're almost certainly on the wrong mode.
Inputs and outputs
Inputs: positive and negative conditioning from a normal CLIP Text Encode, a vae (the Qwen Image VAE), target_latent (an EmptySD3LatentImage works - a 4D latent gets promoted to Krea2's image-like 5D automatically), and the references stack from a Reference Stack node. Then the three knobs: reference_mode, negative_policy (same reference applies the reference to the negative conditioning too; positive only leaves the negative alone), and start_percent / end_percent, which bound when the reference is active. Outside that window the original conditioning runs with no reference at all, so you can hold structure only through the composition phase if you want.
Outputs: re-emitted positive and negative, the target_latent, a prepared_references image so you can eyeball what was actually fitted, and a reference_count int. Wire the conditioning and latent straight into KSampler.
Installation and requirements
Install once for the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/cicalooo/ComfyUI-Krea2-UniDepth
Restart ComfyUI. You need ComfyUI 0.29.2 or newer (native Krea2 reference-latent support), the Krea2 base weights - FP8 recommended, INT8 is the supported floor - the Qwen3-VL 4B text encoder loaded with type krea2, and the Qwen Image VAE. No extra Python packages; the pack ships with zero dependencies. ComfyUI Manager will find it as Krea2-UniDepth.
Where people get burned
If reference_count says 0, nothing happened - the node raises an error rather than silently running, so at least it's honest. The more common failure is the mismatch: a depth / clean t=0 reference fed to a shared-timestep edit LoRA (or the reverse) produces conditioning the LoRA wasn't trained for and output that looks like the reference never arrived. Also remember Krea2 at CFG 1 wants a negative prompt slot even if it's empty - that's a Krea2 quirk, not this node's, and it bites everyone eventually.
One light note: the pack's reference path is deliberately opinionated, so if you're comparing against a Krea2 ControlNet port, expect the behaviour to differ. ControlNets inject a trained copy of the network; this injects tokens into the reference stream. Same goal, entirely different mechanism, and this one keeps your model weights untouched.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| vae | VAE | — | |
| target_latent | LATENT | — | |
| references | KREA2_UNIDEPTH_REFERENCES | — | |
| reference_mode | COMBO | depth / clean t=0 | 2 options: depth / clean t=0, edit / shared timestep |
| negative_policy | COMBO | same reference | 2 options: same reference, positive only |
| start_percent | FLOAT | 0.000–0.99 | — |
| end_percent | FLOAT | 1.000.01–1 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| target_latent | LATENT | — |
| prepared_references | IMAGE | — |
| reference_count | INT | — |