Nodes/was-node-suite-comfyui/CLIPSeg Batch Masking
ComfyUI Node Runs on cloud

CLIPSeg Batch Masking

Mask a whole folder of images with one text prompt

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
CLIPSeg Batch Masking

      CLIPSeg Masking (the singular one) does one image at a time: image in, text prompt in, mask out. WAS's README describes this batch version plainly - "Create a batch image (from image inputs) and batch mask with CLIPSeg" - which is exactly the multiplied version of that same job. Feed it multiple images, give it one text prompt, and get back a batch of masks, each one generated by applying the same CLIPSeg model to the same description across every image in the set.

      The obvious use case is anything that starts with a folder rather than a single file. Pair this with WAS's own Load Batch Images node - which steps through a directory using a glob pattern - and you've got a pipeline that walks a whole folder of, say, product photos or portraits and masks "the subject" (or "the background," or whatever your prompt says) on every single one, without wiring up a separate CLIPSeg node per image or looping manually. That's the entire pitch: same zero-shot, text-driven segmentation as the single-image node, just amortized across a batch so you're not repeating the same wiring N times.

      Worth remembering what CLIPSeg actually is under the hood, since it explains both the power and the limits here: it's a model that jointly embeds an image and a short text description and predicts which pixels the description points at, with no fixed class list and no training required for your specific subject. That flexibility is why it's worth batching - you're not constrained to whatever a pre-trained detector recognizes. But it also means the same prompt has to work reasonably well across every image in your batch; if your folder has wildly inconsistent framing, lighting, or subject matter, a single fixed prompt may land cleanly on some images and produce a noisy, low-confidence mask on others. This isn't a defect specific to WAS's implementation, it's just the nature of running one prompt against a mixed batch - check a few outputs from the middle of your set, not just the first one, before trusting the whole run.

      Inputs are, per the README's own description, multiple images (or an image batch) plus a text prompt; outputs are a batch IMAGE and a batch MASK, ready to feed into a batch inpainting or batch compositing pipeline downstream.

      Installing it: ComfyUI Manager, search "WAS Node Suite," install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/was-node-suite-comfyui, then pip install -r requirements.txt (portable: python_embeded\python.exe -s -m pip install -r requirements.txt; manual/venv: activate the venv first), restart ComfyUI. Like WAS's other model-backed nodes (BLIP being the documented example), expect the CLIPSeg checkpoint to download itself from Hugging Face the first time you actually run a CLIPSeg node rather than at install time.

      Where it bites: running CLIPSeg across a batch is heavier than running it once, so expect this node to take noticeably longer and use more memory than the single-image version on the same hardware - that's expected behavior, not a bug. Beyond that, the standing caveat for this whole pack applies: WAS Node Suite has been unmaintained since December 2023 (its README says "Retired"), and the community's recurring complaint is the entire suite failing to import after a ComfyUI update rather than individual nodes breaking on their own - check your console for a whole-suite import error before troubleshooting this node specifically.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs