Nodes/CRT-Nodes/Isolate Input CLIPSeg (CRT)
ComfyUI Node

Isolate Input CLIPSeg (CRT)

Text-prompted cropping via CLIPSeg

By PGCRT·Created 2 years ago·Updated 2 days ago· 132
Isolate Input CLIPSeg (CRT)
  • images
  • cropped_images
  • pipe
what_to_detectface
performance_presetBalanced
detect_chunk_size10
padding512
threshold0.50
blur_sigma0.0
bbox_expansion1.00
crop_smooth_alpha0.65
crop_megapixels1.00

Meet the budget twin of Isolate Input SAM3.1 (CRT). Same job - find the subject you name in a batch of images or video frames, crop around it, hand a reconstruction pipe to Isolate Output (CRT) - but powered by CLIPSeg instead of SAM 3.1. CLIPSeg is a small text-prompted segmentation model: it reads "face" or "person" and produces a soft mask of where that thing is, no heavy segment-anything machinery required.

The practical difference is speed and weight. CLIPSeg is dramatically lighter and faster than SAM 3.1, and its model (Kijai's clipseg-rd64-refined-fp16) downloads once from Hugging Face and then just runs. The cost is precision: SAM 3.1 understands subjects and instances properly, while CLIPSeg is doing fuzzy text-to-mask matching. For a clean, static "find the face, crop it" job, CLIPSeg is often plenty and much snappier. For tracking a moving subject through a long video with confidence, you'll want the SAM version.

The inputs

Mostly the same surface as the SAM node, with two differences:

  • No single_item toggle - CLIPSeg doesn't do instance detection, so there's nothing to limit. You get whatever the mask finds.
  • blur_sigma is CLIPSeg-specific: it blurs the mask before crop extraction, which smooths out the fuzzy CLIPSeg boundaries and keeps crops from jumping around frame to frame.

Shared knobs: what_to_detect (the text prompt), performance_preset (Fast/Balanced/Quality - defaults to Balanced here, a touch more conservative than the SAM node's Quality default, which tells you what the author thinks each is for), detect_chunk_size (default 10), padding, threshold (default 0.5 - higher than the SAM node's 0.3, again reflecting CLIPSeg's noisier masks), bbox_expansion, crop_smooth_alpha, and crop_megapixels.

Outputs are identical to the SAM version: cropped_images and a pipe bundle that CRT_IsolateOutput consumes unchanged - the CLIPSeg node was deliberately built to produce the same pipe structure, so you can swap the two input nodes freely in a workflow without touching the output side. That's a thoughtful design choice and it's the main reason to keep both nodes installed.

When to pick it

Use CLIPSeg when you want quick crops on a modest batch or an initial pass, or when the "subject" is more of a region ("the car", "the sign") than an instance. Use SAM 3.1 when the crop quality and subject consistency across a long video matter more than speed. The KB's background-removal guide makes a related point about mask quality that applies here too: CLIPSeg's masks are fuzzier, so lean on blur_sigma and bbox_expansion to keep the crop stable, and don't expect clean per-subject separation the way SAM gives you.

Install and gotchas

cd ComfyUI/custom_nodes
git clone https://github.com/PGCRT/CRT-Nodes.git
pip install -r requirements.txt

or ComfyUI Manager → search "CRT-Nodes". Unlike the SAM node, this one does not require the SAM3 PR in ComfyUI - it only needs the pack and transformers (in the requirements), which is a big part of its appeal as the low-friction option. Gotchas: the first run downloads the CLIPSeg model, and the mask quality on complex scenes can be genuinely bad - a prompt like "person" on a cluttered image will smear. Start with threshold at 0.5 and nudge down if the crop is too tight; if CLIPSeg keeps finding the wrong thing entirely, that's the cue to switch to the SAM node.

CategoryCRT/Utils/Isolate

Inputs (10)

NameTypeDefaultDescription
imagesIMAGE
what_to_detectSTRINGfaceText prompt used by CLIPSeg, for example 'face' or 'person'.
performance_presetCOMBOBalancedFast = quickest detection, Balanced = default tradeoff, Quality = highest available quality in the current custom-node path and slower processing.
detect_chunk_sizeINT100–4096Detection batch size. 0 = process the whole batch at once, 1 = per-image processing, 2+ = fixed chunk size.
paddingINT5120–2048Extra border added around the input batch before detection so subjects near the edges are not cropped too tightly.
thresholdFLOAT0.500–1Detection confidence threshold. Lower values find more mask areas, higher values are stricter.
blur_sigmaFLOAT0.00–100Optional blur applied to CLIPSeg masks before crop extraction.
bbox_expansionFLOAT1.000.5–4Expands the detected crop box around the subject. Higher values give a looser crop.
crop_smooth_alphaFLOAT0.650–1Temporal smoothing for crop position. Lower = steadier crop, higher = follows motion more closely.
crop_megapixelsFLOAT1.000–8Target resolution for the cropped output images. 0 disables crop rescaling.

Outputs (2)

NameTypeDescription
cropped_imagesIMAGE
pipeCRT_ISOLATE_PIPE