Nodes/ComfyUI-Transformers/Load Depth Model
ComfyUI Node

Load Depth Model

The Load Node for ComfyUI's Depth Workflow

By kadirnar·Created 3 years ago·Updated 7 months ago· 25
Load Depth Model
    • DEPTH_MODEL
    • IMAGE_PROCESSOR
    model_nameIntel/dpt-hybrid-midas

    Load Depth Model is the setup half of the pack's depth-estimation workflow. It does one job: download a depth model from the Hugging Face Hub and hand you the model plus its image processor, ready to feed into the Depth Estimation node. On its own it does nothing visible - it's the load node, the pattern ComfyUI uses everywhere so that a big model is fetched once and reused across many inference runs.

    It's the one place in this pack where the code steps off the pipeline path. Instead of a transformers.pipeline() wrapper, it uses AutoModelForDepthEstimation.from_pretrained() and AutoImageProcessor.from_pretrained() directly, both with trust_remote_code=True. That's why it can hand back a proper ComfyUI DEPTH_MODEL type rather than a generic string: the model is loaded as an actual object that the inference node can run.

    The inputs and outputs

    • model_name - the Hub model ID as a string, default Intel/dpt-hybrid-midas. DPT-hybrid-MiDaS is the classic Intel depth model - relative depth, sharp edges, the historical ControlNet default.

    Two outputs, and you use both:

    • DEPTH_MODEL - the loaded model object, wired into the model input of Depth Estimation.
    • IMAGE_PROCESSOR - the matching preprocessor, wired into the processor input.

    This is a two-node pattern, not a standalone one: Load Depth Model → Depth Estimation (with your image into the latter) is the whole workflow.

    How to install it

    Standard pack install - ComfyUI Manager (search "ComfyUI-Transformers") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kadirnar/ComfyUI-Transformers
    

    Restart ComfyUI. The DPT-hybrid-MiDaS checkpoint is a few hundred MB and downloads on first load - expect the node to sit there for a bit before it reports success. requirements.txt covers the transformers stack.

    Where people get burned

    The main trap is thinking this node is broken because "nothing happened" - it's a loader, so output only appears downstream in the inference node. The other is expecting the modern default: MiDaS is the classic depth baseline, but the community has largely moved to Depth Anything for sharper edges. You can type a compatible model ID into this node if it supports the depth-estimation task, but the pack ships in MiDaS framing. And since model_name is a free string, a typo means a failed load - copy IDs carefully from the Hub.

    CategoryTransformers/DepthEstimation

    Inputs (1)

    NameTypeDefaultDescription
    model_nameSTRINGIntel/dpt-hybrid-midas

    Outputs (2)

    NameTypeDescription
    DEPTH_MODELDEPTH_MODEL
    IMAGE_PROCESSORIMAGE_PROCESSOR