Nodes/ComfyUI-Grounding/Grounding Mask Model (down)Loader
ComfyUI Node

Grounding Mask Model (down)Loader

Florence-2 Seg or the SA2VA Big Boys

By PozzettiAndrea·Created 10 months ago·Updated about 23 hours ago· 47
Grounding Mask Model (down)Loader
    • model
    modelFlorence-2: Base (Segmentation)
    sa2va_dtypeauto
    keep_model_loadedtrue

    This is the sibling of the Grounding Model (down)Loader, except instead of 19 box detectors it loads the six models that produce masks directly: Florence-2 Base and Large in segmentation mode, plus ByteDance's SA2VA in four sizes (1B, 4B, 8B, 26B). It hands a ready MASK_MODEL to the Grounding Mask Detector, which is the node that actually turns your sentence into a cutout.

    The choice here is really a quality-versus-VRAM decision with two camps. Florence-2 is the small, fast, pragmatic option - the default Florence-2: Base (Segmentation) is a fine starting point that most people never leave. SA2VA is the heavy artillery: a vision-language model that can reason about a scene and segment accordingly. It's the reason people tolerate multi-GB downloads and real VRAM pressure, because it nails prompts that GroundingDINO-style detectors mangle.

    The inputs

    • model - the dropdown: two Florence-2 segmentation variants, four SA2VA sizes. Default is Florence-2 Base Seg.
    • sa2va_dtype - SA2VA only. auto (default) lets the pack pick; otherwise fp16/bf16/fp32. If you're tight on VRAM, fp16 is the lever you'll reach for.
    • keep_model_loaded - defaults to true, like the other loaders: the model parks in VRAM for instant repeat detections. Turn it off to offload after each run, which is the right call when Flux or another heavy model is sharing the card.

    Output is the single model wire into Grounding Mask Detector. Nothing happens at load time except the download - no detection runs here.

    How it works

    Pick a model and the pack downloads it from Hugging Face on first use (Florence-2 from Microsoft, SA2VA from ByteDance), then caches it in memory so switching back is instant. The same smart-cache behavior as the box-model loader - the pack treats every model uniformly.

    Installing it

    Same one-pack install for the whole set:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/PozzettiAndrea/ComfyUI-Grounding
    cd ComfyUI-Grounding
    pip install -r requirements.txt
    

    Then restart ComfyUI, or install "ComfyUI-Grounding" from ComfyUI Manager. The install script also tries to set up flash_attn from a prebuilt wheel (it's what makes Florence-2/SA2VA inference tolerable); if your torch/CUDA combo has no matching wheel it skips gracefully.

    Where people get burned

    • SA2VA 26B is a server model. 26 billion parameters means tens of GB of weights and a VRAM bill most home rigs can't pay. The 1B and 4B are the realistic picks for a 24GB card and under; be honest with yourself before clicking 26B.
    • First run looks broken - SA2VA weights are huge, so the first load can sit there for a long while. It's downloading, not frozen.
    • The keep_model_loaded toggle actually matters here - these mask models are bigger than the box detectors. If your workflow dies with an OOM after a detection pass, flipping it off is the first fix.
    • Shared GPU state - the README warns that this pack (SA2VA/Florence-2 patch global CUDA/TF32 state) can't reliably coexist with kijai's GIMM-VFI. Same caveat applies to everything in this pack, but the mask models are the biggest offenders.
    Categorygrounding

    Inputs (3)

    NameTypeDefaultDescription
    modelCOMBOFlorence-2: Base (Segmentation)6 options: Florence-2: Base (Segmentation), Florence-2: Large (Segmentation), SA2VA: 1B, SA2VA: 4B, SA2VA: 8B, SA2VA: 26B
    sa2va_dtypeoptCOMBOauto🎨 SA2VA ONLY! Model precision: auto=automatic selection, fp16=half precision, bf16=bfloat16, fp32=full precision
    keep_model_loadedoptBOOLEANtrueKeep model in VRAM after loading. Disable to free VRAM after each detection (slower but uses less memory)

    Outputs (1)

    NameTypeDescription
    modelMASK_MODEL