Nodes/SimpleSyrup/Tag SEGS w/ External LLM
ComfyUI Node

Tag SEGS w/ External LLM

A vision model that writes a regional prompt for every crop

By Artificial-Sweetener·Created 3 months ago·Updated 12 days ago· 2
Tag SEGS w/ External LLM
  • image
  • segs
  • clip
  • segs
  • positive
modelConfigure external LLM endpoint
system_prompt
user_prompt
universal_positive
seg_image_modetransparent mask
replace_underscoretrue
trailing_commafalse
exclude_tags
max_tokens1024
reasoning_effortdefault

WD14 tags are great if you're on an anime checkpoint and your crops are things with Danbooru vocabulary. For everything else - photoreal scenes, objects, "describe what's actually in this crop" - a tag vocabulary is the wrong tool. SimpleSyrup.TagSEGSWithExternalLLM is the general-purpose alternative: it sends each SEG crop to a vision-capable LLM through an OpenAI-compatible endpoint, gets back a natural-language description, and encodes it into per-region conditioning matched to your SEGS order. If WD14 is the regional tagger for booru models, this is the regional captioner for everything else.

The mechanism: for each SEG, it crops the region from the source image, shows the vision model that crop (with pixels outside the mask handled per seg_image_mode, default showing them as a transparent mask so the model sees the object in context), and sends it along with your user_prompt. The model's reply becomes the region's prompt, universal_positive text gets prepended, and the whole thing is CLIP-encoded with your connected clip into the positive conditioning batch - aligned with the segs that come out on the matching output. The system_prompt is your chance to steer how it writes ("describe only clothing," "output comma-separated tags," etc.).

Before anything works, you have to configure the provider. SimpleSyrup has two ComfyUI settings: "External LLM endpoint" (the OpenAI-compatible base URL) and "External LLM API key" (stored in your OS credential storage via the keyring dependency - a nice touch, the key isn't sitting in your workflow JSON). Save both and the model dropdown populates with the provider's models. That dropdown's default - "Configure external LLM endpoint" - is the node's way of telling you you haven't done the setup yet. The model you pick needs vision support; a text-only model will fail the moment it's handed an image.

Inputs worth your attention:

  • system_prompt / user_prompt - the two halves of your instruction. Empty by default, and empty means you get whatever the model feels like, so write these.
  • max_tokens (default 1024) - caps reply length; higher costs more per call.
  • reasoning_effort - default default omits provider-specific reasoning controls; off explicitly disables thinking for providers that support it through chat-template options. If your provider charges more for reasoning tokens, off is probably right for a tagging job.
  • replace_underscore, trailing_comma, exclude_tags - the same output-shaping trio as the WD14 node, because whatever the model writes still has to survive CLIP encoding cleanly.

Outputs: segs and positive. Same contract as the WD14 sibling - regions and their conditioning travel together into regional samplers.

The honest economics: this is a paid, networked node. Every region is an API call, so a 40-region image is 40 billed calls, and the VLM weakness this space knows well - multi-subject attribution - applies to crops too. It's for when WD14's vocabulary genuinely can't describe what you're detailing, and the cost is the price of that. Also worth knowing: this category has a documented malware history in ComfyUI (the LLMVISION incident), so the author storing keys in OS keyring and using your own configured endpoint is the safe shape - but it's still an LLM node that reaches the network, so use an endpoint you control and a provider you trust.

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). No model downloads (the LLM lives on the provider's side). If model shows only the configure placeholder, the endpoint or key setting didn't save - recheck Settings → SimpleSyrup and make sure you saved after entering them.

CategorySimpleSyrup/Detailing

Inputs (13)

NameTypeDefaultDescription
imageIMAGESource image that the incoming SEGS were detected from.
segsSEGSExisting SEGS to describe and keep aligned with the conditioning batch.
clipCLIPCLIP model used to encode each generated regional prompt.
modelCOMBOConfigure external LLM endpointExternal vision model used to describe each SEG crop.
system_promptSTRINGInstruction text that controls how the model writes regional tags.
user_promptSTRINGPer-region request sent with each SEG crop image.
universal_positiveSTRINGPositive prompt text added before every generated regional prompt.
seg_image_modeCOMBOtransparent maskHow pixels outside each SEG mask are shown to the vision model.
replace_underscoreBOOLEANtrueReplace underscores in generated tags before CLIP encoding.
trailing_commaBOOLEANfalseAdd a final comma to each generated regional prompt.
exclude_tagsSTRINGComma-separated exact tags removed from generated regional prompts.
max_tokensINT10241–32768Maximum number of response tokens the external model may generate. Higher values allow longer replies but can take longer and cost more.
reasoning_effortCOMBOdefaultReasoning behavior for compatible providers. Default omits provider-specific controls; off sends thinking disabled through chat template options.

Outputs (2)

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