ComfyUI Node

MarigoldDepthEstimation

The original all-in-one Marigold depth node

By kijai·Created 3 years ago·Updated about a year ago· 570
MarigoldDepthEstimation
  • image
  • ensembled_image
seed123
denoise_steps10
n_repeat10
regularizer_strength0.020
reduction_methodmedian
max_iter5
tol0.0010
inverttrue
keep_model_loadedtrue
n_repeat_batch_size2
use_fp16true
schedulerDDIMScheduler
normalizetrue
modelMarigold

This is the node the pack originally shipped with, before Diffusers added an official Marigold pipeline and kijai split things into a loader plus MarigoldDepthEstimation_v2. It's a single, self-contained node - no separate loader, model selection is right there on the node - and it exposes every knob of the original ensembling process directly. If you've ever wondered what "ensembling" actually means for a diffusion depth model, this node spells it out in its own parameter list.

Why it still exists alongside v2

Two reasons you'd pick this over the newer node. First, it only offers the depth models (Marigold and marigold-lcm-v1-0), so if all you want is depth and don't care about normals or lighting decomposition, there's nothing extra to navigate. Second, it exposes the ensembling internals - regularizer_strength, reduction_method, max_iter, tol - that v2 hides. Kijai's own honest take on those, straight from the README: "generally do not touch" - they're settings for the median/mean merge step across repeated passes, and the defaults were tuned by someone who actually understands the math, so leave them unless you have a specific reason not to.

How it works

Marigold is a generative depth model - it denoises a depth map out of noise, conditioned on your image, the same way Stable Diffusion denoises an image out of noise conditioned on a prompt. This node runs that process n_repeat times (independent passes with different noise) and merges them into a steadier ensembled_image, using whichever reduction_method you picked. More repeats means a more reliable map and a longer wait - there's no way around that tradeoff with a generative model.

The inputs and outputs that matter

The ones you'll actually touch:

  • model (optional, default Marigold) - the base model, or marigold-lcm-v1-0 for the distilled fast version. If you switch to LCM, drop denoise_steps down to around 4 and switch scheduler to LCMScheduler - the README is explicit about this pairing.
  • denoise_steps (default 10) and n_repeat (default 10) - steps per pass, and passes ensembled together. Both trade accuracy for time, independently.
  • n_repeat_batch_size (default 2) - how many of those n_repeat passes run as an actual batch instead of sequentially. If you have the VRAM to match it to n_repeat, do it - it's a straightforward speed win for zero quality cost.
  • invert (default true) - Marigold's raw output has black as close and white as far, which is backwards from what ControlNet and most downstream tools expect. Leave this on unless you have a specific reason to want the raw orientation.
  • use_fp16 (default true) - fp16 roughly halves VRAM use; the author notes it can occasionally cost a bit of quality, but it's the default for a reason.

Everything else - regularizer_strength, reduction_method, max_iter, tol - is the ensembling math; leave at defaults per the note above. One output: ensembled_image (IMAGE).

How to install it

ComfyUI Manager: search "marigold". Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-Marigold
pip install -r ComfyUI-Marigold/requirements.txt

This node needs the model in diffusers format separately from the pack itself - if it's not found, it auto-downloads via huggingface_hub on first run. If that fails (blocked network, etc.), grab it manually from huggingface.co/Bingxin/Marigold and drop it in ComfyUI/custom_nodes/ComfyUI-Marigold/checkpoints or ComfyUI/models/diffusers.

Common issues & troubleshooting

It's slow, and cranking n_repeat or denoise_steps makes it worse. That's the expected shape of the tradeoff - this is a diffusion process, not a single forward pass. If speed genuinely matters more than maximum quality, switch model to marigold-lcm-v1-0 with LCMScheduler and a handful of steps rather than fighting the base model's settings.

Runs out of VRAM. Make sure use_fp16 is actually on, and pull n_repeat_batch_size back down if you pushed it up to match n_repeat - that's the one setting here that trades VRAM for speed directly.

Depth looks inverted relative to what a ControlNet or other tool expects. Check invert - it defaults to true for exactly this reason, but if you toggled it off (or you're comparing against Marigold's raw HuggingFace output), that's the difference.

Import or dependency errors on install. This pack talks to Diffusers directly; if another custom node pack in your environment pins a conflicting Diffusers version, reinstalling this pack's requirements.txt inside your actual ComfyUI venv usually clears it.

CategoryMarigold

Inputs (15)

NameTypeDefaultDescription
imageIMAGE
seedINT1230–18446744073709550000
denoise_stepsINT101–4096
n_repeatINT101–4096
regularizer_strengthFLOAT0.0200.001–4096
reduction_methodCOMBOmedian2 options: median, mean
max_iterINT51–4096
tolFLOAT0.00100.000001–0.1
invertBOOLEANtrue
keep_model_loadedBOOLEANtrue
n_repeat_batch_sizeINT21–4096
use_fp16BOOLEANtrue
schedulerCOMBODDIMScheduler5 options: DDIMScheduler, DDPMScheduler, PNDMScheduler, DEISMultistepScheduler, LCMScheduler
normalizeBOOLEANtrue
modeloptCOMBOMarigold2 options: Marigold, marigold-lcm-v1-0

Outputs (1)

NameTypeDescription
ensembled_imageIMAGE