Nodes/Krea2-UniDepth/Krea2-UniDepth Conditioning
ComfyUI Node

Krea2-UniDepth Conditioning

The one node that makes Krea2 follow a depth map

By cicalooo·Created 20 days ago·Updated 19 days ago· 1
Krea2-UniDepth Conditioning
  • positive
  • negative
  • vae
  • depth_image
  • image
  • references
  • target_latent
  • positive
  • negative
  • target_latent
  • prepared_depth
  • reference_latent
width1024
height1024
batch_size1
fit_modecenter_crop
negative_policysame reference
start_percent0.00
end_percent1.00
pad_value0.00
calibratefalse
low_percent1.0
high_percent99.0
gamma1.00
polaritykeep
smoothing_radius0
smoothing_strength0.00
edge_epsilon0.010

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_crop preserves aspect ratio and fills the target; letterbox keeps the full map and pads; stretch forces it to target geometry (best only when aspect ratios already match, or you want intentional distortion).
  • calibrate plus 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 connect target_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.

CategoryKrea2-UniDepth

Inputs (23)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
depth_imageIMAGE
widthINT102416–16384
heightINT102416–16384
batch_sizeINT11–4096
fit_modeCOMBOcenter_crop3 options: center_crop, letterbox, stretch
negative_policyCOMBOsame reference2 options: same reference, positive only
start_percentFLOAT0.000–0.99
end_percentFLOAT1.000.01–1
pad_valueFLOAT0.000–1
calibrateBOOLEANfalse
low_percentFLOAT1.00–49
high_percentFLOAT99.051–100
gammaFLOAT1.000.1–4
polarityCOMBOkeep2 options: keep, invert
smoothing_radiusINT00–32
smoothing_strengthFLOAT0.000–1
edge_epsilonFLOAT0.0100.0001–0.25
imageoptIMAGE
referencesoptKREA2_UNIDEPTH_REFERENCES
target_latentoptLATENT

Outputs (5)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
target_latentLATENT
prepared_depthIMAGE
reference_latentLATENT