Nodes/Remove Background (SET)/Load Depth Anything by name
ComfyUI Node

Load Depth Anything by name

Load Depth Anything by name — the loader that feeds the depth node

By set-soft·Created about a year ago·Updated 9 months ago· 18
Load Depth Anything by name
    • da_v2_model
    model

    Every DAMODEL has to come from somewhere, and this is the somewhere. DownloadAndLoadDepthAnythingV2Model_SET is the loader half of the pack's Depth Anything V2 pair: pick a model name, it downloads the safetensors from Kijai's HuggingFace repo into ComfyUI/models/depthanything, loads it, and hands you a model for the Depth Anything V2 node. On its own it does nothing visible; paired with that node (or used to feed PDFNet's depth channel) it's the machinery behind the pack's depth-guided background removal.

    The model dropdown has eight entries, and unlike some loaders in this pack, the names tell you everything:

    • Small F16 (47 MiB) / Small F32 (95 MiB) - the 24.8M-parameter ViT-S.
    • Base F16 (186 MiB) / Base F32 (372 MiB) - the 97.5M ViT-B. This is what PDFNet was trained with, so for anything inside this pack, it's your default.
    • Large F16 (640 MiB) / Large F32 (1.3 GiB) - the 335M ViT-L. Overkill for PDFNet, right for standalone depth work.
    • Large Metric Indoor F32 / Large Metric Outdoor F32 - metric-depth variants (Hypersim / VKITTI) that output actual distances rather than relative depth. Only reach for these if you genuinely need meters.

    The 16-bit versions are the sensible defaults: the tooltip says they work quite well for most uses, and the F32 versions are roughly double the size for accuracy you probably can't see. The description does add one caution - "F16 might reduce quality, be careful" - so if your depth output starts looking mushy, that's the first knob to flip back to F32.

    What you set

    Just model (a STRING/combo). There are no device or dtype inputs - the node picks your GPU and matches precision to the file you chose (fp16 for the F16 variants, fp32 otherwise). The single output is da_v2_model (DAMODEL), ready for the Depth Anything V2 node or wherever else the pack expects a depth model.

    Install

    Part of the same pack, nothing extra:

    cd ComfyUI/custom_nodes
    git clone https://github.com/set-soft/ComfyUI-RemoveBackground_SET
    pip install -r ComfyUI-RemoveBackground_SET/requirements.txt
    

    ComfyUI 0.3.48+, seconohe >= 1.0.6 (fresh copy via pip install git+https://github.com/set-soft/seconohe.git if it errors on import). First use of each variant downloads it into ComfyUI/models/depthanything.

    Two small notes. The author adapted this from Kijai's ComfyUI-DepthAnythingV2 specifically because he didn't like silent downloads with no progress and cryptic filenames - so this version shows progress and keeps names readable, a small quality-of-life thing you'll appreciate on a 1.3 GiB download. And while it's here to serve PDFNet, nothing stops you using this + Depth Anything V2 as a general-purpose depth tool in ComfyUI, which saves you installing Kijai's pack if you don't already have it. Start at Base F16; go bigger only if your use case actually needs it.

    CategoryRemBG_SET/Load

    Inputs (1)

    NameTypeDefaultDescription
    modelCOMBOThe name of the model to use. Small, Base and Large are available in 16 and 32 bits. The 16 bits version works quite well for most uses. PDFNet was trained using the Base version.

    Outputs (1)

    NameTypeDescription
    da_v2_modelDAMODELThe model ready to be used by the `Depth Anything V2` node