ComfyUI Node

🌆DepthFM

The DepthFM node worth keeping around

By ZHO-ZHO-ZHO·Created 2 years ago·Updated 2 years ago· 74
🌆DepthFM
  • model
  • image
  • IMAGE
steps2
ensemble_size2

DepthFM was CompVis's 2024 entry into the "generative depth" race - same lab that gave you Stable Diffusion - and ZHO-ZHO-ZHO wrapped it for ComfyUI within a week of the release. It's not the default you should reach for; that's still Depth Anything V2 for most jobs. But in the big eight-model comparison the community ran on ComfyUI, DepthFM was called out for "good contrast despite small differences in depth," and more than a few people said it outright: "I like DepthFM best." It's the node you reach for when you want a depth map with real fine detail and don't feel like sitting through Marigold's nine seconds per step.

The pitch is speed with detail. Instead of denoising step by step like Marigold, DepthFM is a flow-matching model: it encodes your image into a latent with a Stable Diffusion 1.5 VAE, then solves a probability-flow ODE from the image latent to a depth latent in a handful of Euler steps. That's why the defaults are so small. steps (default 2, range 1–100) is the number of ODE solver steps - 2–4 for everyday use, up to 10 when you want cleaner edges. ensemble_size (default 2, max 10) repeats the input, runs the solve several times, and averages the results, which smooths out noise at the cost of VRAM and time. In the official comparison it ran at 10 steps / ensemble 9 on a 4090 and still finished well under a minute.

The node itself is lean. Required inputs are model (a DepthFMMODEL from the 🌆DepthFM ModelLoader), image (the IMAGE you want measured), and the two settings above. The output is a single IMAGE: a normalized grayscale map where brightness encodes distance. One quirk worth knowing - the wrapper flips the raw model output with 1.0 - depth, so if a downstream depth ControlNet behaves as if your polarity is backwards, drop a color-invert node after it and check again.

Install is the pack's shared routine, via ComfyUI Manager (search "DepthFM") or:

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

Then restart ComfyUI. The only real dependency is torchdiffeq, the ODE solver. The model itself is not auto-downloaded: grab depthfm-v1.ckpt from ommer-lab.com/files/depthfm and drop it in ComfyUI/models/depthfm/. The first load also pulls the SD 1.5 VAE from HuggingFace, so keep internet on for that first run.

Where people get burned: the image dimensions must be multiples of 64 (the VAE will not forgive you - resize first); the loader hardcodes .cuda(), so this pack is NVIDIA-only, no Apple Silicon fallback; and it runs FP32, so the checkpoint plus VAE eat real VRAM. Also temper expectations on accuracy - the community found DepthFM can hallucinate detail it thinks it sees and "is not so accurate in terms of distance." For reliable geometry, use Depth Anything. For maps with texture you can feel, this is the one.

Category🌆DepthFM

Inputs (4)

NameTypeDefaultDescription
modelDepthFMMODEL
imageIMAGE
stepsINT21–100
ensemble_sizeINT21–10

Outputs (1)

NameTypeDescription
IMAGEIMAGE