Nodes/SimpleSyrup/Tag SEGS w/ WD14
ComfyUI Node

Tag SEGS w/ WD14

Per-region tags, then per-region conditioning, in the same order

By Artificial-Sweetener·Created 3 months ago·Updated 12 days ago· 2
Tag SEGS w/ WD14
  • image
  • segs
  • clip
  • wd14_tagger
  • segs
  • positive
universal_positive
threshold0.35
character_threshold1.00
replace_underscoretrue
trailing_commafalse
exclude_tags1girl, solo, long_hair, short_hair, silhouette

Here's the detailer problem nobody talks about until it bites: when you detail a detected region - a face, a character, a logo - the refinement pass needs a prompt for that region, and writing one prompt that's right for every crop in the image is nonsense. The face crop wants a face prompt, the shirt crop wants a shirt prompt. SimpleSyrup.TagSEGSWithWD14 automates the boring half: it runs a WD14 tagger on each SEG crop, generates tags for that specific region, encodes them into conditioning, and hands you a conditioning batch aligned one-to-one with your SEGS. Then the pack's regional samplers apply prompt number one to region one, prompt two to region two, and so on.

This is the ComfyUI version of a pattern ADetailer users know well: the [SEP] prompt batch where the first prompt is global and each later prompt binds to its corresponding detection. The tagger is the part that makes it not-maddening - instead of hand-writing N regional prompts, WD14 reads each crop and writes them for you.

How it works: you connect the source image, the existing segs, a clip (for encoding), and a wd14_tagger (from the pack's Load WD14 Tagger, which loads a SmilingWolf WD14 ONNX model and its tag CSV). Each SEG crop gets tagged; the tags become that region's prompt; universal_positive text gets prepended to every generated prompt (your "this is a character, high quality" baseline); and the results are CLIP-encoded into the positive conditioning batch, in SEGS order. The original segs come back out on a matching output so you can't lose track of which region is which.

The inputs that actually change results:

  • threshold (default 0.35) - minimum WD14 confidence for general tags. Raise it to keep only certain tags; lower it to get more, noisier ones.
  • character_threshold (default 1) - minimum confidence for character tags. That default is telling: at 1.0, only tags WD14 is 100% certain about survive the character filter, which is a deliberate "don't invent character names" stance. If you want character tags to actually appear, lower it toward the general threshold.
  • replace_underscore (default on) - turns long_hair into long hair so the CLIP prompt reads naturally.
  • exclude_tags - the default is already populated: 1girl, solo, long_hair, short_hair, silhouette. That's the author's sensible starting set - the tags that are nearly always redundant in a regional crop and would just dilute the conditioning. Add your own frequent offenders.

Outputs: segs (original SEGS, same order) and positive (CONDITIONING_BATCH). This is a Detailing-category node, and the point is the pair: the regions and their conditioning travel together, which is exactly what the pack's KSampler (Prompt by Region) and regional samplers consume.

Install: the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Artificial-Sweetener/SimpleSyrup
cd SimpleSyrup && pip install -r requirements.txt

or ComfyUI Manager → search SimpleSyrup → Install → restart, with a current ComfyUI (v3 extension API). WD14 runs on ONNX, and onnxruntime is in the pack's requirements. The tagger model itself (a SmilingWolf WD14 ONNX) is loaded through the separate Load WD14 Tagger node, which can fetch a known catalog model. Order mismatches between segs and positive don't really happen here - they're built in the same pass - which is the quiet win over doing tags and encoding in separate disconnected steps.

CategorySimpleSyrup/Detailing

Inputs (10)

NameTypeDefaultDescription
imageIMAGEImage that the incoming SEGS were detected from.
segsSEGSExisting SEGS to crop, tag, and keep in their current order.
clipCLIPCLIP model used to encode each generated SEGS prompt.
wd14_taggerWD14_TAGGERWD14 tagger that reads each SEG crop and suggests prompt tags.
universal_positiveSTRINGPositive prompt text added before every generated SEGS tag prompt.
thresholdFLOAT0.350–1Minimum WD14 confidence for general tags. Higher values keep fewer, more certain tags.
character_thresholdFLOAT1.000–1Minimum WD14 confidence for character tags. Higher values keep fewer, more certain character tags.
replace_underscoreBOOLEANtrueReplace underscores with spaces so generated tags read more naturally.
trailing_commaBOOLEANfalseAdd a comma after generated tag text for easier prompt composition.
exclude_tagsSTRING1girl, solo, long_hair, short_hair, silhouetteComma-separated tags removed from generated tile prompts.

Outputs (2)

NameTypeDescription
segsSEGSOriginal SEGS returned in the same order as the conditioning batch.
positiveCONDITIONING_BATCHPositive conditioning from WD14 SEGS tags, matched to SEGS order.