Nodes/ComfyUI-DAViD/DAViD Multi-Task (Depth/Normal/Foreground)
ComfyUI Node

DAViD Multi-Task (Depth/Normal/Foreground)

Depth, normals, and a person-shaped cutout — from one model pass

By AIWarper·Created about a year ago·Updated about a year ago· 6
DAViD Multi-Task (Depth/Normal/Foreground)
  • image
  • depth_map
  • normal_map
  • foreground_rgb
  • foreground_mask
model_namemultitask-vitl16_384.onnx
inverse_depthfalse
binarize_foregroundfalse
foreground_threshold0.50

One node, three maps

Need a depth map, a surface-normal map, and a clean person cutout from the same photo? DAViDMultiTask is the one-stop shop: it runs a single model and hands you all three at once, batch-friendly, ready to wire into compositing, depth effects, or relighting work.

The thing to know up front: this model is aimed at people. DAViD (Microsoft Research's "Data-efficient and Accurate Vision models from synthetic Data", ICCV 2025) is trained largely on synthetic human data, and that's why it's worth adding to a stack that already has Depth Anything. On human subjects its depth and segmentation are genuinely strong. That's also its honest limit - throw a landscape or a car at it and a general-purpose model like Depth Anything or Marigold will serve you better. You reach for this one when the subject is a person and you want geometry.

How it works

Under the hood it's an ONNX model (ViT-L backbone, 384px input) pushed through onnxruntime with CUDA first and CPU as fallback. The wrapper iterates your whole batch, converts each frame from ComfyUI's RGB float tensor into the BGR uint8 the model expects, runs all three tasks in a single inference, then reshapes the results into ComfyUI tensors. The runtime is lifted straight from Microsoft's DAViD repo, so the mechanism is the paper's own, not a loose reimplementation.

The inputs that matter

Only image is strictly required. Of the options you'll actually set:

  • inverse_depth - flips the depth map so nearer pixels are brighter. Try it once with, once without, and you'll never think about it again.
  • binarize_foreground with foreground_threshold (0–1) - the model returns a soft mask; tick this to hard-cut it for a clean composite.

model_name is a dropdown that lists whatever .onnx files it finds in your models/david folder.

The four outputs

  • depth_map - already colored (TURBO colormap), ready to preview or feed into a depth-aware effect.
  • normal_map - RGB visualization of surface orientation, remapped to [0,1]. This is exactly what the pack's "Normal to Lighting" node wants to eat.
  • foreground_rgb - the mask rendered as a gray RGB image, handy for previewing.
  • foreground_mask - a true MASK output. Plug it straight into Image Composite and you've got background replacement without a separate segmentation model in the graph.

Installing it

ComfyUI Manager may not list this pack yet - the README says as much - so the reliable route is the clone:

cd ComfyUI/custom_nodes
git clone https://github.com/AIWarper/ComfyUI-DAViD

Here's the gotcha: requirements.txt is entirely commented out. It assumes a normal ComfyUI env already has torch, OpenCV and numpy (it does). The one thing you're probably missing is onnxruntime-gpu:

pip install onnxruntime-gpu

Then the models, which download separately - nothing is bundled:

mkdir -p ComfyUI/models/david
wget https://facesyntheticspubwedata.z6.web.core.windows.net/iccv-2025/models/multi-task-model-vitl16_384.onnx -O ComfyUI/models/david/multitask-vitl16_384.onnx

The README points at ComfyUI-DAViD/models/david/ instead - the code checks both locations, so either works, but the models/david path survives reinstalls. Restart ComfyUI and the node appears under the "DAViD" category.

Where people get burned

  • Video. The README is blunt: the research team confirmed DAViD wasn't trained to be temporally stable across frames, so frame-by-frame it shimmers. Treat it as a stills tool.
  • Missing models. If inference throws a FileNotFoundError, the node prints the exact paths it searched - just put the file where it asks.
  • onnxruntime quirks. If you hit provider errors, the README's fix is to pin onnxruntime-gpu==1.16.3. Without the GPU package it still runs on CPU, and on a ViT-L 384 model that's a patience exercise.
CategoryDAViD

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
model_nameoptCOMBOmultitask-vitl16_384.onnx1 options: multitask-vitl16_384.onnx
inverse_depthoptBOOLEANfalse
binarize_foregroundoptBOOLEANfalse
foreground_thresholdoptFLOAT0.500–1

Outputs (4)

NameTypeDescription
depth_mapIMAGE
normal_mapIMAGE
foreground_rgbIMAGE
foreground_maskMASK