Nodes/ComfyUI-InfiniDepth/Load InfiniDepth Model
ComfyUI Node

Load InfiniDepth Model

The loader that expects a whole other repo to live next door

By snomiao·Created 6 months ago·Updated 6 months ago· 0
Load InfiniDepth Model
    • model
    model_type
    depth_ckptcheckpoints/depth/infinidepth.ckpt
    moge2_ckptcheckpoints/moge-2-vitl-normal/model.pt

    This is the fiddly half of the InfiniDepth pair, so let's be upfront about what you're signing up for. Most depth packs are one node and an auto-downloaded model. This loader instead assumes the upstream YvanYin/InfiniDepth research repo is cloned on your machine, with checkpoints sitting outside ComfyUI's normal model folders. It's the kind of setup that makes people bounce off - but it's also why the whole pack works, so it's worth understanding before you blame the node.

    Its actual job is simple: read the model type and checkpoint paths you give it, load the depth model from that upstream repo, and hand a ready-to-use INFINIDEPTH_MODEL to the InfiniDepth Depth Estimation node. Two nodes, one loader, and the loader is where the install friction lives.

    How it works

    The loader resolves your paths against the InfiniDepth repo root, found either via the INFINIDEPTH_ROOT environment variable or by auto-detecting an InfiniDepth/ folder as a sibling of the pack. Then it does something worth respecting: it monkey-patches the upstream model's __init__, which force-calls self.cuda() and hard-checks CUDA, temporarily replacing both so ComfyUI controls device placement instead. That single patch is the reason the pack runs on MPS and CPU at all, not just CUDA. It also pulls in MoGe-2 (Microsoft's metric geometry model) at load time - that's the weight that gives InfiniDepth its metric scale and camera intrinsics downstream.

    The inputs that matter

    • model_type - pick InfiniDepth (the base model) or InfiniDepth_DepthSensor (a different checkpoint, the depth-sensor flavor of the pipeline).
    • depth_ckpt - path to the .ckpt. Defaults to checkpoints/depth/infinidepth.ckpt relative to the InfiniDepth repo root. This trips people up constantly. If the auto-detection isn't finding the repo, just paste an absolute path - the loader accepts those directly and skips the guessing.
    • moge2_ckpt - path to the MoGe-2 weights, default checkpoints/moge-2-vitl-normal/model.pt, same relative-or-absolute rules.

    The one output

    model (INFINIDEPTH_MODEL) - a custom type that only the InfiniDepth Depth Estimation node accepts. There's nothing else you can plug it into, which is actually a relief: no wrong wiring, just one place it goes.

    Installing it (the real way)

    ComfyUI Manager will clone the pack for you, but it won't handle the rest. You need:

    cd ComfyUI/custom_nodes
    git clone https://github.com/snomiao/ComfyUI-InfiniDepth.git
    git clone https://github.com/YvanYin/InfiniDepth.git
    # tell the pack where the repo is:
    export INFINIDEPTH_ROOT="$PWD/InfiniDepth"
    # (or set it permanently in your shell profile / launcher script)
    cd ComfyUI-InfiniDepth
    pip install -r requirements.txt
    python install.py   # installs MoGe and gsplat from git
    

    Then download the checkpoints from the HuggingFace repo into the layout the defaults expect - checkpoints/depth/infinidepth.ckpt, checkpoints/depth/infinidepth_depthsensor.ckpt, checkpoints/moge-2-vitl-normal/model.pt, plus the gs and skyseg files the README lists. Note the requirements.txt pins numpy<2.0 and pulls heavy deps like open3d, roma, and e3nn - this is not a light install, and it shares your ComfyUI Python environment like everything else.

    Troubleshooting

    • ModuleNotFoundError: InfiniDepth - the upstream repo isn't on the path. Set INFINIDEPTH_ROOT, or make sure InfiniDepth/ sits as a sibling of the pack folder.
    • Checkpoint not found at load - either the download layout is wrong or path detection missed. Absolute paths in the two ckpt fields are the escape hatch.
    • It loaded - you'll see [InfiniDepth] Loaded <type> from <path> in the console. Loading happens CPU-side; the model moves to the GPU when the estimate node runs, which is the whole point of that patch.
    Categorydepth/InfiniDepth

    Inputs (3)

    NameTypeDefaultDescription
    model_typeCOMBO2 options: InfiniDepth, InfiniDepth_DepthSensor
    depth_ckptSTRINGcheckpoints/depth/infinidepth.ckptPath to depth checkpoint (relative to InfiniDepth repo root, or absolute).
    moge2_ckptSTRINGcheckpoints/moge-2-vitl-normal/model.ptPath to MoGe-2 checkpoint for metric scale recovery.

    Outputs (1)

    NameTypeDescription
    modelINFINIDEPTH_MODEL