Nodes/Image Processing Suite for ComfyUI/Load SAM2 Model (AnotherUtils)
ComfyUI Node

Load SAM2 Model (AnotherUtils)

Load Segment Anything 2 — for stills or video — weights fetched automatically

By marcoc2·Created 2 years ago·Updated 5 months ago· 1
Load SAM2 Model (AnotherUtils)
    • ANOTHER_MODEL
    model_namesam2_hiera_small.pt
    modesingle_image
    device

    Load SAM2 Model (AnotherUtils) is the other half of the pack's detect-then-segment story. It loads Meta's Segment Anything 2 (SAM2) - the zero-shot segmentation model that can outline almost any object you point it at - and, like its YOLO sibling, it downloads the weights itself on first use into models/sam2. No manual checkpoint hunting; the README's "no weight hunting" promise holds here.

    The model_name dropdown lists the four SAM2 hierarchy sizes - sam2_hiera_tiny, small, base_plus, and large (default small) - plus anything .pt you drop into your models/sam2 or models/another_utils folders. The choice is the usual VRAM-versus-quality trade: tiny and small are the practical defaults on consumer cards, base_plus and large are for when you need finer masks and have the memory. The mode input is the interesting one: single_image loads SAM2 for one-shot segmentation of a still, while video loads the stateful video variant used for tracking a subject across frames. That single dropdown changes the whole service that gets wired up behind the scenes, so pick it before anything else.

    The output, as with the YOLO loader, is the pack-internal ANOTHER_MODEL type - which is a strong hint about the intended architecture. SAM2 here isn't a replacement for the official ComfyUI-SAM2 or Impact Pack's SAM loaders; it's the backend for the pack's own inference nodes: AnotherSAM2Inference for stills, and AnotherSAM2VideoAddPoints / AnotherSAM2VideoPropagate for tracking. The typical chain is detector-first: AnotherLoadYOLO finds objects, the detection results become SAM2 prompts (see the pack's SEGStoSAM2Points), and SAM2 refines them into precise masks - then in video mode it propagates those masks across the whole clip. That's the full zero-dependency inference suite, self-contained and conflict-free with the big packs.

    Gotchas worth knowing before the first run. First-run download needs internet and patience - the hierarchy checkpoints are tens to hundreds of MB, and mode: video loads a bigger stateful predictor, so the first execute in video mode can feel like a hang when it's really fetching weights. device: auto is a decent guess but if inference errors on a multi-GPU or shared box, forcing cuda or cpu is the first debugging step. And because it emits ANOTHER_MODEL, you can't feed this into non-AnotherUtils SAM2 nodes - the walled-garden design is deliberate, and it's the price of not fighting over dependencies.

    Install: ComfyUI Manager → search "AnotherUtils", or cd ComfyUI/custom_nodes && git clone https://github.com/marcoc2/ComfyUI-AnotherUtils, then restart. No pip requirements - the embedded services keep your environment clean.

    CategoryAnotherUtils/inference

    Inputs (3)

    NameTypeDefaultDescription
    model_nameCOMBOsam2_hiera_small.pt4 options: sam2_hiera_base_plus.pt, sam2_hiera_large.pt, sam2_hiera_small.pt, sam2_hiera_tiny.pt
    modeCOMBOsingle_image2 options: single_image, video
    deviceCOMBO3 options: auto, cuda, cpu

    Outputs (1)

    NameTypeDescription
    ANOTHER_MODELANOTHER_MODEL