SAX SAM3 Loader
Get Meta's text-prompt segmenter into your workflow, without the VRAM fight
- SAM3_MODEL
SAM 3 is the segmenter that made text-driven masking mainstream - you type "hair" or "face" and get back a mask, no trained detector required. But it's a heavy model, and the naive way of loading it in ComfyUI leaves it hogging VRAM next to your diffusion model. SAX SAM3 Loader exists to fix exactly that: it loads a SAM 3 checkpoint and places it under ComfyUI's own VRAM management, so it shares memory with your other models and gets offloaded to CPU when it's not the active thing. Feed its CSAM3_MODEL output into the SAX SAM3 Multi Segmenter and you're masking by text.
This is the "open-vocabulary segmentation" step the KB's masking-detection-detailing doc describes: where a trained YOLO can only find faces/hands/persons, SAM 3 finds whatever you name. You type the region, it masks it, and that mask feeds a detailer or an inpainting pass. It's the modern replacement for the old GroundingDINO + SAM two-node pipeline.
Inputs
Two, and that's it:
model_name- the checkpoint file, frommodels/sam3/. Drop your.pt/.pthfiles there and they appear in the dropdown.precision-fp32(highest quality, the author's recommendation),bf16(lower VRAM, needs an Ampere+ GPU),fp16(lower VRAM, Volta+), orauto(let it pick for your GPU).
For most people the decision is: start at fp32 if it fits, drop to bf16 if you're sharing VRAM with a big diffusion model. That's the same trade ladder as everywhere else in this ecosystem - quality for memory.
The install gotcha (this is where people get burned)
The node itself is part of the pack, but SAM 3's Python library is not. It's an optional dependency you must install yourself, and the README is explicit that the node only works when sam3 is present:
pip install git+https://github.com/facebookresearch/sam3.git
On Windows there's an extra step first, because SAM 3 depends on Triton, which was historically Linux-only. Install a Triton that works on your platform before installing sam3:
- PyTorch ≥ 2.7 + CUDA ≥ 12.8:
pip install triton - Older PyTorch/CUDA:
pip install triton-windows(a drop-in compatible wheel that bundles TinyCC and a minimal CUDA toolchain)
If SAM 3 fails to load, the pack shows you the underlying ImportError - typically No module named 'triton' - so the missing-dependency diagnosis is at least self-evident. The README also notes SAM 3's checkpoints carry their own license terms, separate from the permissive Apache 2.0 of SAM/SAM 2, so if you're shipping anything commercially, glance at that before you build a product on it.
Where it fits
Wire it into SAX SAM3 Multi Segmenter for text-prompt masking, then into SAX Mask Adjust to grow/shrink the result per branch, then into a SAX Detailer for refinement - the README's whole "segment → detail → compare" loop. It's a load-once node, so one SAM3 Loader can feed multiple segmenters without reloading the model each time. The VRAM management is the actual point: on a 12GB card, a SAM 3 checkpoint that just sat in memory would blow your generation budget; under ComfyUI's patcher it steps aside when the diffusion model needs the space.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | Checkpoint file in models/sam3/. | |
| precision | COMBO | fp32 | Model precision. fp32: highest quality (recommended). bf16: reduced VRAM (Ampere+). fp16: reduced VRAM (Volta+). auto: select best for GPU. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SAM3_MODEL | CSAM3_MODEL | — |