Krea2-UniDepth Conditioning
The one node that makes Krea2 follow a depth map
- positive
- negative
- vae
- depth_image
- image
- references
- target_latent
- positive
- negative
- target_latent
- prepared_depth
- reference_latent
Krea2-UniDepth Conditioning is the heart of this pack: you feed it a ready-made depth map, it fits that map to your exact output geometry, VAE-encodes it as clean timestep-zero reference tokens, creates the target latent, and hands you conditioning that makes Krea2 draw along the depth structure. It's the Krea2-native answer to a depth ControlNet - no copied network, no wrapped model forward, just the reference-latent path the model already has. Krea2 just didn't expose it for this before this pack did.
The depth map itself you still source from somewhere else - Depth Anything or another preprocessor. The node's job starts once you have that grayscale guide. And importantly, the map is "preserved as supplied except for the selected geometry fit": no silent rebalancing, unless you opt in with the built-in calibration controls.
How it works
The pipeline is short and worth knowing because it explains every control. The depth image is optionally calibrated (percentile clipping, gamma, polarity, edge-preserving smoothing - all off by default), fitted to the target in pixel space with no latent interpolation, VAE-encoded with the Qwen Image VAE, and attached as the first entry in an ordered reference-latent list using Krea2's clean t=0 modulation. If you also connect the optional image or a references stack, those get VAE-encoded and appended after the depth map - which is how you retain source composition and appearance while a normal CLIP Text Encode supplies the prompt. The node also creates the target latent (a 5D image-like Krea2 latent) unless you override it with target_latent.
Inputs and outputs
positive and negative come from a stock CLIP Text Encode with the Krea2 CLIP; vae is the Qwen Image VAE; depth_image is your map. Then the settings that actually move the needle:
fit_mode-center_croppreserves aspect ratio and fills the target;letterboxkeeps the full map and pads;stretchforces it to target geometry (best only when aspect ratios already match, or you want intentional distortion).calibrateplus the calibration fields - off by default; turn it on when your map is flat, banded, or inverted.start_percent/end_percent- bounds the reference's active window; ~0.65–0.85 can preserve structure while allowing more late texture freedom.width/height/batch_size- set the output unless you connecttarget_latent, which then wins.
Outputs: re-emitted positive / negative, the target_latent, prepared_depth (an IMAGE preview of exactly what got encoded - always glance at it the first time), and reference_latent if you want to inspect or reuse the encoded guide. All three of the sampler inputs come straight from this node: positive, negative, and latent.
The starting recipe
The README's recommended baseline is simple: 8 steps, CFG 1, Euler, simple scheduler; every LoRA section at 1.0; calibration off; reference range 0.0–1.0. The packed depth workflow wires UNETLoader → Functional LoRA Loader → KSampler.model, with the Conditioning node feeding positive/negative/latent, and the prompt is "Generate a detailed realistic image that follows the supplied depth structure."
Prompt-led outpainting (the free trick)
There's no registered outpainting path here, but the README documents a genuinely useful one: set the depth LoRA strength to 0.9, add padding around the depth guide with letterbox to create unconstrained canvas, and prompt the complete intended scene. The padded region gives the model room beyond the preserved depth composition, and the reduced LoRA strength leaves more freedom for prompt-driven continuation. It's empirical rather than mask-aware, so consistency still depends on composition, padding, prompt, and seed - but it beats adding an outpainting extension for a quick canvas extension.
Install and gotchas
The whole pack installs once:
cd ComfyUI/custom_nodes
git clone https://github.com/cicalooo/ComfyUI-Krea2-UniDepth
Restart, and you need ComfyUI 0.29.2+, the Krea2 FP8 base (INT8 is the supported floor), the Qwen3-VL 4B encoder via CLIPLoader type krea2, the Qwen Image VAE, and the pack's functional depth LoRA from Hugging Face sitting in ComfyUI/models/loras/. No extra Python packages. The two things that bite newcomers: an older ComfyUI without native reference-latent support, and a missing Qwen3-VL encoder or VAE - people routinely grab the base weights and skip the other two files, then blame the model.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| vae | VAE | — | |
| depth_image | IMAGE | — | |
| width | INT | 102416–16384 | — |
| height | INT | 102416–16384 | — |
| batch_size | INT | 11–4096 | — |
| fit_mode | COMBO | center_crop | 3 options: center_crop, letterbox, stretch |
| 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 | — |
| pad_value | FLOAT | 0.000–1 | — |
| calibrate | BOOLEAN | false | — |
| low_percent | FLOAT | 1.00–49 | — |
| high_percent | FLOAT | 99.051–100 | — |
| gamma | FLOAT | 1.000.1–4 | — |
| polarity | COMBO | keep | 2 options: keep, invert |
| smoothing_radius | INT | 00–32 | — |
| smoothing_strength | FLOAT | 0.000–1 | — |
| edge_epsilon | FLOAT | 0.0100.0001–0.25 | — |
| imageopt | IMAGE | — | |
| referencesopt | KREA2_UNIDEPTH_REFERENCES | — | |
| target_latentopt | LATENT | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| target_latent | LATENT | — |
| prepared_depth | IMAGE | — |
| reference_latent | LATENT | — |