Nodes/ComfyUI Assistant Node/PVL Depth Anything V2 (fal.ai)
ComfyUI Node

PVL Depth Anything V2 (fal.ai)

A depth map from the cloud, zero preprocessor setup

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Depth Anything V2 (fal.ai)
  • image
  • depth_map

Depth maps are a workhorse input: feed one into a ControlNet, a relighting pass, or a 3D-ish parallax effect and suddenly flat images have structure. Locally, getting one means installing a preprocessor node, downloading Depth Anything weights, and often babysitting a model that wants more VRAM than you'd like. This node skips the whole ceremony - it's a single wrapper over fal.ai's fal-ai/image-preprocessors/depth-anything/v2 endpoint. You feed it an image, it returns a depth map, and the heavy lifting happens on fal's servers. The trade is the usual one for this pack: it costs fal credits per call and needs a FAL_KEY.

Depth Anything V2 is the right model for the job, too. As the KB's depth-estimation essay notes, the V2 line - and especially the Giant variant at 1.3B parameters - is the quality ceiling for relative depth estimation, with far better generalization to odd scenes than earlier models. Through the API you don't care how big the weights are; the node sends your image and you get the V2 result back.

How it works

Simple under the hood: the node takes your IMAGE tensor, encodes it as a base64 PNG data URI, POSTs it to the fal endpoint with an image_url argument, then downloads the returned depth image and converts it back to a ComfyUI IMAGE tensor (1,H,W,3). One honest limitation from the source: it only accepts a single image - a batch of more than one raises an error, so don't feed it a batch expecting N maps.

Inputs and outputs

One input: image (required). That's it - no resolution, no model-size, no seed, nothing to fiddle. Output is a single depth_map (IMAGE). Wire it into a ControlNet preprocessor socket (if your ControlNet node accepts an already-processed map), a relight node, or wherever you were going to paste a depth map. Because there are no knobs, the node's entire job is "make the API call readable from ComfyUI."

Install

The whole pack, as usual:

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

Restart ComfyUI, then set FAL_KEY in the environment that launches ComfyUI (checked as FAL_KEY, FAL_API_KEY, or FAL_CLIENT_KEY - get one at fal.ai/dashboard). The pack's requirements.txt is heavier than this node needs, but ComfyUI Manager will sort it.

Where people get burned

  • It's a one-shot utility, not a batching tool. If you need depth for 50 frames of a video, calling this per-frame will be slow and will rack up a bill; you'd be better off with the local Depth Anything nodes (like the ComfyUI ControlNet preprocessor equivalents) or a dedicated batch pipeline.
  • The map comes back in the API's own format. Expect a standard grayscale-ish relative depth map, not metric depth - Depth Anything V2's relative output is the norm here, and that's what most ComfyUI consumers (ControlNet, relight) actually want.
  • No offline fallback. If fal is down or your credits run out, the node fails with a clear "FAL: no input image frames" or key error - there's no local mode hiding in here.
CategoryPVL_tools

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
depth_mapIMAGE