Nodes/ComfyUI-LocateAnything/LocateAnything Model Loader
ComfyUI Node

LocateAnything Model Loader

Loading NVIDIA's LocateAnything-3B

By alisson-anjos·Created 3 months ago·Updated 2 months ago· 17
LocateAnything Model Loader
    • model
    model_sourcenvidia/LocateAnything-3B
    download_modeltrue
    deviceauto
    dtypeauto
    attentioneager
    use_batch_runtimefalse
    runtime_attentionla_flash
    vision_attentionauto
    schedulerpipeline
    group_size0
    strict_attnfalse

    Every LocateAnything workflow starts here, and this node does two jobs: it downloads the NVIDIA LocateAnything-3B checkpoint if you don't have it, then loads it into a runtime the Grounding node can use. The download is the part you'll feel - roughly 7.8 GB the first time, into ComfyUI/models/LocateAnything/nvidia--LocateAnything-3B. Plan for it, go make coffee, come back.

    The loader is where the pack's compatibility magic actually lives. NVIDIA's checkpoint is a remote-code model, meaning loading it executes Python files shipped inside the Hugging Face repo (trust_remote_code=True - the node handles that for you). The catch with remote-code models is they're frozen against the transformers version they shipped with, and transformers moves. This node patches the known API mismatches at load time - a Qwen2ForCausalLM weights-key change, an attention-implementation signature shift - so the model keeps loading without you hand-editing files in your HF cache. That's genuinely the difference between this pack working in six months and becoming a GitHub issue graveyard.

    Inputs that matter

    You can honestly leave most of these alone. The ones a beginner touches:

    • model_source - Hugging Face repo ID (nvidia/LocateAnything-3B by default) or a local directory if you've already got a snapshot.
    • download_model - on by default. Disables cleanly if you want to place the files yourself and skip the network.
    • device - auto (uses ComfyUI's device), cuda, cpu, or mps. NVIDIA CUDA is the recommended path; CPU is exposed for compatibility but will be painfully slow for a 3B VL model.
    • dtype - auto picks bfloat16/float16 on CUDA and float32 on CPU. Just leave it.
    • attention - eager (the default) is the conservative, compatibility-first path; sdpa can be faster but less stable on some setups. If the Grounding node acts up and you see "reload with attention=eager" in the log, this is the knob.

    The deeper knobs - use_batch_runtime, runtime_attention, scheduler, group_size, strict_attn - control NVIDIA's optional hybrid batch runtime for multi-frame batches. use_batch_runtime is off by default for good reason: it needs the newer snapshot files (batch_utils/ and kernel_utils/) that aren't always present in a downloaded snapshot, and it depends on optional attention backends like MagiAttention for full speed. Leave it off for your first runs. If you do flip it on and get an import error about batch_utils, the message tells you the fix: update the snapshot or turn it back off.

    Output

    One output: model, of type LOCATEANYTHING_MODEL. That single wire goes into the model input of LocateAnything Grounding, and optionally through LocateAnything Unload Model at the end.

    Install

    Search ComfyUI-LocateAnything in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alisson-anjos/ComfyUI-LocateAnything.git
    cd ComfyUI-LocateAnything
    pip install -r requirements.txt
    

    Restart ComfyUI, then load the node. The dependencies are reasonable for a VL-model pack - transformers (pinned <5), accelerate, timm, huggingface-hub, numpy, Pillow. Nothing exotic, which is the good news. The heavy lifting is the model download, not the pip install.

    Issues and gotchas

    • The license. Read it before you run. The LocateAnything-3B checkpoint is under NVIDIA's license - academic and non-commercial research only. The pack's integration code is GPL-3.0. That matters if you have any thought of shipping something.
    • Remote code is a trust decision. The node executes Python from the HF repo. That's normal for this class of model, but it's worth knowing what you're agreeing to.
    • First load is slow even after the download. A 3B model has to map in; subsequent loads are faster, and the Unload node frees VRAM when you're done.
    • trust_remote_code failures or transformer errors on an old snapshot usually mean your local copy is stale - download_model + a fresh model_source pull fixes it.
    • Two runtimes, one decision: if you're doing single-image grounding, the default serial path is right. The batch runtime is a speed optimization for video-frame batches on supported NVIDIA GPUs, and it's strictly optional - the node falls back to serial inference when it's unavailable.

    It's not a glamorous node - it's the plumbing. But it's also the part that determines whether this whole pack runs on your machine or eats your afternoon. Set it to defaults, let it download, and go.

    CategoryLocateAnything

    Inputs (11)

    NameTypeDefaultDescription
    model_sourceSTRINGnvidia/LocateAnything-3BHugging Face repo ID or local snapshot directory.
    download_modelBOOLEANtrueDownload missing model files into models/LocateAnything.
    deviceCOMBOautoExecution device. auto uses the device selected by ComfyUI; cuda is recommended when available.
    dtypeCOMBOautoModel precision. auto selects bfloat16 or float16 on CUDA and float32 on CPU.
    attentionCOMBOeagerEager is the conservative compatibility path. SDPA can be faster but may be less stable on some setups.
    use_batch_runtimeBOOLEANfalseUse the official hybrid batch runtime from the model snapshot when available.
    runtime_attentionCOMBOla_flashAttention backend for the optional official batch runtime.
    vision_attentionCOMBOautoVision attention backend for the optional official batch runtime.
    schedulerCOMBOpipelineHybrid batch scheduler used by the official batch runtime.
    group_sizeINT00–1024Batch runtime hybrid grouping. 0 keeps the upstream default.
    strict_attnBOOLEANfalseRequire the configured batch attention backend instead of allowing runtime fallback.

    Outputs (1)

    NameTypeDescription
    modelLOCATEANYTHING_MODELLoaded LocateAnything runtime shared with grounding nodes.