(Down)load CLIPSeg
Text-prompted masks, model auto-downloaded
- clipseg_model
CLIPSeg is the "mask by typing a word" model. Instead of painting a mask by hand or running a full segmentation stack, you say "the dog" or "the sky" and it produces a mask of that thing. It's lightweight, fast, and shockingly convenient for quick region-targeting, exactly the kind of thing you want in front of an inpaint or a targeted color grade. This node's job is the boring-but-essential half: it fetches the CLIPSeg weights and loads them, handing you a model object the actual segmentation node consumes.
It's part of kijai's KJNodes. Note the loader is only step one, it loads CLIPSeg; you pair it with the node that runs the segmentation and turns your text prompt into a mask.
How it works
On first run it downloads the CLIPSeg model via huggingface_hub into ComfyUI/models/clip_seg, then loads it and outputs a CLIPSEGMODEL. Because it caches to that folder, the download only happens once; after that it loads from disk. The auto-download is the whole convenience of the "DownloadAndLoad" naming, no manual hunting for weights, no placing files by hand.
The inputs and outputs that matter
model- a dropdown with two choices:Kijai/clipseg-rd64-refined-fp16andCIDAS/clipseg-rd64-refined. TheCIDASone is the original upstream model; theKijaione is an fp16 repack that's smaller and lighter to load. For most people the fp16 version is the obvious pick, it's the same model at half the footprint. Grab the CIDAS original only if you specifically want full precision.
The output is clipseg_model (a CLIPSEGMODEL). That goes into the CLIPSeg segmentation node, where you supply the actual text prompt and image and get your mask.
Installing it
You probably already have KJNodes. If not: ComfyUI Manager → search KJNodes for ComfyUI → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-KJNodes
pip install -r ComfyUI-KJNodes/requirements.txt
Restart ComfyUI. The CLIPSeg weights themselves aren't bundled, they download on first use, so the very first run needs internet access and will pause while it fetches into ComfyUI/models/clip_seg.
Common issues
First run hangs or fails to download. This node reaches out to HuggingFace on first use. If you're offline, behind a proxy, or HF is having a moment, the download stalls. Once it succeeds, the weights are cached in ComfyUI/models/clip_seg and it won't re-download. On a locked-down or offline box, you can place the model files there manually.
"Where's my mask?" This node doesn't make masks, it loads the model. The CLIPSEGMODEL output has to feed the CLIPSeg segmentation node, which is where you type the prompt (e.g. "hair", "background") and actually get a mask out.
The mask is rough around the edges. CLIPSeg is fast and convenient but not pixel-perfect, it produces soft, approximate masks. That's usually fine going into an inpaint (which feathers anyway), but if you need a crisp cutout, run the CLIPSeg mask through a grow/blur/threshold cleanup, or reach for a heavier segmentation/matting model.
fp16 vs the original. If you picked CIDAS/clipseg-rd64-refined and it's loading slowly or eating more memory than you'd like, switch to Kijai/clipseg-rd64-refined-fp16. Same model, lighter load.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | 2 options: Kijai/clipseg-rd64-refined-fp16, CIDAS/clipseg-rd64-refined |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| clipseg_model | CLIPSEGMODEL | — |