ComfyUI Node

Load DepthPro Model

The 500MB gateway to Apple's ml-depth-pro

By EricRollei·Created 8 months ago·Updated 4 months ago· 19
Load DepthPro Model
    • depth_model
    model_name
    deviceauto
    precisionfloat32

    DepthProModelLoader is the one-node setup that turns Apple's ml-depth-pro - one of the highest-quality metric depth estimators in the ComfyUI bake-offs - into a reusable DEPTH_PRO_MODEL object that feeds DepthPro Estimate. It's a loader in the purest sense: pick a checkpoint, pick a device, pick a precision, get a model. There's no depth math in this node; all of that happens downstream.

    The inputs

    • model_name (required) - a dropdown of .pt files in your ComfyUI checkpoints/ folder. Yes, the checkpoints folder - the same place your diffusion checkpoints live. Drop the downloaded depth_pro.pt there and it shows up.
    • device (auto) - auto picks CUDA when available, else CPU. You can force either.
    • precision (float32) - float32 gives best quality; float16 uses less VRAM. The default is already the quality pick, which is honest - this model runs fine on most cards either way.

    One output: depth_model.

    Where to get the weights

    The ~500MB checkpoint comes from apple/DepthPro on HuggingFace and goes to ComfyUI/models/checkpoints/depth_pro.pt. The Python package is a separate, slightly annoying install because it's a git+URL:

    pip install git+https://github.com/apple/ml-depth-pro.git --no-deps
    pip install pillow_heif
    

    If you forget it, the node doesn't fail cryptically - it throws an ImportError that literally prints that install command. That's a small courtesy and worth appreciating.

    What to know before you build on it

    • License. Apple ships ml-depth-pro under its Sample Code license, which the README flags as "research only". Fine for personal experiments and refocusing your own photos; check the terms before you put DepthPro-derived output in a commercial product. (FLUX.1-dev, the other half of the full pipeline, is separately non-commercial.)
    • The loader reads the first frame of a batch at estimate time, so don't bother batching.
    • VRAM footprint is modest by FLUX standards - DepthPro's ViT-based backbone is a few hundred MB in float32, a fraction of what the refocus FLUX pipeline wants. You can hold both in memory on a 12GB+ card, which is why the refocus workflow can afford to run depth and bokeh in one graph.
    • Where it differs from the pack's defaults: the KB's depth doc notes Depth Anything V2 is the community's daily driver for ControlNet preprocessing, while DepthPro earns its keep on metric quality and sharp structure. This pack uses it because the refocus pipeline wants genuinely good disparity maps, not because it's the ControlNet default. Different job, different tool.

    Install

    It's one of the always-available nodes in the Refocus pack - ComfyUI Manager ("Refocus - Generative Refocusing") or git clone https://github.com/EricRollei/comfyui-refocus into custom_nodes/, then restart. No diffusers needed for this node; the base requirements (torch, safetensors) already ship with ComfyUI. The only real install step beyond the clone is the ml-depth-pro package and the checkpoint itself.

    CategoryRefocus/Depth

    Inputs (3)

    NameTypeDefaultDescription
    model_nameCOMBOSelect depth_pro.pt model from checkpoints
    deviceoptCOMBOautoDevice to load the model on
    precisionoptCOMBOfloat32Model precision. float32 gives best quality, float16 uses less VRAM.

    Outputs (1)

    NameTypeDescription
    depth_modelDEPTH_PRO_MODEL