Krea2-UniDepth Reference Stack
Chainable ordered references — frame 1, frame 2, frame 3
- image
- references
- references
- count
Krea2-UniDepth Reference Stack is the small plumbing node that feeds the pack's edit mode: it adds one image to an ordered reference stack, and you chain copies of it to build as many references as you want. The first image you add becomes RoPE frame 1, the next frame 2, and so on, and each one keeps its own fit and appearance settings so you can mix geometries in a single edit.
It looks trivial, and it sort of is - but the ordering is the entire point. Krea2's reference path treats references as frames with a defined order, so a two-reference stack means "here's the composition, and here's the appearance I want on top of it," not "here are two images, figure it out." Chain order is reference order. If you get the order backwards, you'll know, because the edit will look like the wrong image won.
Inputs and outputs
image is the reference itself, from a LoadImage. Then three per-image settings:
fit_mode-center_crop,letterbox, orstretch, applied when the reference is fitted to the target geometry at encode time. Keep source and target aspect ratios close for edits; the pack's own workflow warns about this.image_mode-rgbfor ordinary photos, or one of the depth modes (depth_grayscale,depth_normalize,depth_invert,depth_normalize_invert) when the "reference" you're stacking is actually a depth guide.pad_value- what fills the padding inletterboxmode.
The optional references input is where the chaining happens: connect one stack's output here to append, and you get back a longer stack. Outputs are references (a typed KREA2_UNIDEPTH_REFERENCES value - you can't just drop an IMAGE into a Conditioning node's reference slot) and a count int so you can confirm how many frames you've built.
Where it fits
There are two consumers. In the edit workflow it feeds Krea2-UniDepth Apply References, which VAE-encodes the whole stack at the final target geometry and attaches it to conditioning. In the depth workflow, the main Conditioning node accepts an optional references input too, appending the stack after the depth map - that's how you add a source composition on top of a depth guide in one pass. Each reference is fitted and encoded independently at the final geometry, so you don't need to pre-crop anything yourself.
The README's edit wiring, roughly: LoadImage → Reference Stack → Apply References, with CLIP Text Encode feeding the prompt, EmptySD3LatentImage the target latent, and VAELoader the VAE. Then KSampler. Use edit / shared timestep on the Apply node for an edit LoRA trained with its source on the live timestep.
Install
Same as the rest of the pack - one install, five nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/cicalooo/ComfyUI-Krea2-UniDepth
Restart ComfyUI. You'll need the shared Krea2 stack underneath (base weights, Qwen3-VL 4B encoder via CLIPLoader type krea2, Qwen Image VAE, ComfyUI 0.29.2+), and for edit mode the edit LoRA you're using, wherever it lives in loras. No model downloads are tied to this node specifically, and there are no extra Python packages.
The trap
The one real gotcha is forgetting this is a typed value, not an IMAGE. If you try to wire a LoadImage straight into a reference input on another node, ComfyUI won't let you - there's no such connection. If that happens, the stack node is the missing link, and count will confirm you've actually built something. And if you're stacking a depth map as a reference, remember image_mode - feeding it as rgb will carry it through as an appearance reference, which is not the same thing as a structural depth guide.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| fit_mode | COMBO | center_crop | 3 options: center_crop, letterbox, stretch |
| image_mode | COMBO | rgb | 5 options: rgb, depth_grayscale, depth_normalize, depth_invert, depth_normalize_invert |
| pad_value | FLOAT | 0.000–1 | — |
| referencesopt | KREA2_UNIDEPTH_REFERENCES | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| references | KREA2_UNIDEPTH_REFERENCES | — |
| count | INT | — |