π§© SAMModel Loader
The dropdown that decides how good your mask is
- SAM_MODEL
SDVN SAMModelLoader is the boring half of the pack, and the boring half is where you make the actual quality decisions. It takes one dropdown - which SAM checkpoint - and hands you a ready-to-run SAM_MODEL object. Nothing else happens here. The segmentation smarts live in SDVN DinoSAMSegment; this node just decides which Segment Anything you're running, downloads it if needed, and loads it onto your GPU.
The one input, and it's the whole game
Seven checkpoints, and the names are honest about what you're trading:
- sam_vit_h (2.56GB) - the biggest, best-quality mask. Start here if VRAM allows; it's the model most Segment Anything workflows actually use.
- sam_vit_l (1.25GB) / sam_vit_b (375MB) - middle and light.
sam_vit_bis the sensible default when you don't need the flagship. - sam_hq_vit_h / sam_hq_vit_l / sam_hq_vit_b - the SAM-HQ variants, tuned for crisper edges on small, thin, or fiddly structures. Same price in VRAM as their base versions; worth it if your masks have ragged edges on details.
- mobile_sam (39MB) - tiny and fast, noticeably weaker masks. For quick previews or constrained hardware, not for production cutouts.
The model loads through the pack's bundled sam_hq registry (the HQ models need the HQ predictor, and the loader picks it automatically from the filename), then gets moved to your primary torch device. One grounded gotcha from the source: the loader derives the model type from the checkpoint filename, so don't rename these files. Rename sam_vit_b_01ec64.pth and the registry lookup quietly breaks.
Where the file actually lands
Auto-download on first use into ComfyUI/models/sams/. Pick a model, hit run, and the loader pulls it with download_url_to_file if it isn't there. That's the easy path for six of the seven. The odd one out: the mobile_sam URL in the pack points at a GitHub blob page rather than a raw file, so its auto-download tends to fail. If you want MobileSAM, grab mobile_sam.pt from the MobileSAM repo by hand and drop it in models/sams/. If big downloads are crawling, set HTTP_PROXY and HTTPS_PROXY before launching ComfyUI, as the README suggests.
Wiring it up
Output is a single SAM_MODEL. Feed it into SDVN DinoSAMSegment's sam_model input. The useful trick: one loader output can fan out to several segment nodes, so the 2.5GB model loads once and serves every segment step in your workflow. That's the whole reason the modular version of this pack exists.
Troubleshooting
- "Not found / download stuck" - first-run downloads are multi-GB and silent; give it a couple of minutes before assuming failure. On a slow link, proxy env vars are the README's own answer.
- mobile_sam never finishes - that's the blob-URL issue above; download manually.
- Weird registry errors after you moved a file - check the filename survived intact. The loader parses it.
No other dependencies, no config files, no extra VRAM beyond the checkpoint itself. Loader nodes are the least glamorous things in ComfyUI, but with a 2.5GB model riding on the choice, this dropdown is where you actually pick your result quality.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | 7 options: sam_vit_h (2.56GB), sam_vit_l (1.25GB), sam_vit_b (375MB), sam_hq_vit_h (2.57GB), sam_hq_vit_l (1.25GB), sam_hq_vit_b (379MB), +1 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SAM_MODEL | SAM_MODEL | β |