Nodes/ComfyUI-ZipDepth/ZipDepth Estimate
ComfyUI Node

ZipDepth Estimate

A 6M-Parameter Depth Model With No Dependencies and No Excuses

By Hullabalo·Created 26 days ago·Updated 15 days ago· 6
ZipDepth Estimate
  • image
  • depth
  • depth_colormap
◄colormapSpectral►
◄invertfalse►

Every other depth node in ComfyUI opens with a download. Depth Anything V2 Large is 335M parameters of ViT before you get your first map. ZipDepth Estimate wants a 27 MB checkpoint and literally nothing else - no transformers, no timm, not even matplotlib, despite shipping five colormaps.

What it is, and when you'd actually grab it

ZipDepth Estimate is monocular depth estimation: your image goes in, a grayscale map comes out where brightness means distance. It's relative depth - near versus far, not meters - which is exactly what conditioning wants. Depth Anything V2 Large has been the default depth preprocessor since 2024 and nothing has knocked it off, so this node isn't competing for that crown.

It's for the other 80% of the time. You want a depth map now, on a laptop, on CPU, on a 40-image batch, before you've decided whether you care about quality. Six million parameters puts the forward pass closer to a color conversion than a model inference.

Where it's a bad idea: fine edges, hair, thin architecture, glass and mirrors. A 384px-resolution CNN hands you blobby gradients there, and a strict depth ControlNet pass built on blobby gradients looks blobby. That's Depth Anything V2 territory.

Adjust your expectations on reputation too. ZipDepth has essentially no community footprint - it's a small research model with a quiet wrapper, not a hidden gem, and nobody in the threads is comparing notes on it.

How it works

The node loads the official zipdepth_base.pth from Fabio Tosi's original repo, folds the model for inference, and predicts. The encoder is a RepVGG-style CNN - each block is 3x3 + 1x1 + identity branches, fused into a single 3x3 conv at load time, which is where both the tiny size and the speed come from - stacked over four resolutions with light attention pieces (squeeze-and-excite, strip pooling, a global context block, SPPF). The decoder upsamples with a learned "convex" head: per pixel it predicts softmax weights over the nine neighbouring depth values instead of interpolating bilinearly. Cheap, and sharper than plain bilinear.

Then the wrapper does three things you can feel in your output:

  • Resizes so the shorter side is ~384px (multiple of 32, aspect preserved) and resizes the result back to your input resolution. A 4K input still carries roughly 384-class detail.
  • Min-max normalizes each image against its own min and max, so every image comes out with full black-to-white contrast. Nice for eyeballing, bad for comparing one frame to the next.
  • Runs on CUDA if it's there, CPU otherwise - chosen once on first load and cached in a module global.

The inputs and outputs

Three inputs, two outputs, and you'll only touch one of them.

  • image (IMAGE) - the only one that's mandatory.
  • colormap (Spectral, Turbo, Inferno, Viridis, Magma, default Spectral) - cosmetic. It only affects the second output.
  • invert - the author's tooltip: "Default: near = white. Enable for near = black." Flip it when whatever's downstream expects the opposite convention - displacement or height-field work, or a mask you'd rather have inverted.

Outputs:

  • depth - grayscale IMAGE, min-max normalized per image, near = 1.0 (white) by default. This is the one you wire into a depth ControlNet (weight ~0.4–0.7, end step ~0.4–0.6 - loose guidance is where soft maps behave), a parallax or DepthFlow-style node, a displacement/3D-print height field, or ImageToMask for a rough depth mask.
  • depth_colormap - the same values through a baked 256-entry LUT. Preview it, save it, don't feed it anywhere. (It indexes the LUT backwards, so the nearest pixel gets the first stop of the ramp - red for Spectral, dark blue for Turbo. Not meaningful, just how it's wired.)

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Hullabalo/ComfyUI-ZipDepth.git

Restart ComfyUI. Or use ComfyUI Manager and search the pack title - it ships Comfy Registry metadata (PublisherId = "hullabaloo"), so Manager will find it.

The checkpoint is the part that bites. It downloads itself on the first run, not at install, and lands at:

ComfyUI/custom_nodes/ComfyUI-ZipDepth/checkpoints/zipdepth_base.pth

On an offline box or behind a proxy, the clone succeeds and the run fails. Everything else is free: colormaps.py bakes its LUTs in as hex, pyproject.toml declares dependencies = [], and the only import outside the standard library is torch - which ComfyUI already gave you.

Common issues

First-run download dies halfway. The code checks os.path.isfile and nothing else - no hash, no temp file. A truncated download means every later run fails at torch.load instead of retrying. Delete the file and run again.

Your depth map looks mushy. It's 384px on the short side. That's the model, not a bug. Swap to Depth Anything V2 Large before you start fiddling with ControlNet weights to compensate.

Video flickers. Each frame is min-max normalized independently and there's zero temporal awareness, so brightness jumps on top of the usual frame-by-frame jitter. Video wants a video-native model like DepthCrafter.

Device is fixed at load. CPU vs GPU is decided once, on the first execution, and cached.

CategoryZipDepth

Inputs (3)

NameTypeDefaultDescription
imageIMAGE—
colormapCOMBOSpectral5 options: Spectral, Turbo, Inferno, Viridis, Magma
invertBOOLEANfalseDefault: near = white. Enable for near = black.

Outputs (2)

NameTypeDescription
depthIMAGE—
depth_colormapIMAGE—