Nodes/ComfyUI-Ichis-Pack/ICHIS Extract Tags
ComfyUI Node

ICHIS Extract Tags

Pull the face tags out of a prompt without mangling the rest

By ichabodcole·Created about a year ago·Updated 11 months ago· 2
ICHIS Extract Tags
    • extracted_text
    text
    concepts
    delimiter,

    Say you've got a long comma-joined prompt - portrait of a woman, beautiful eyes, big blue eyes, wearing big red clown nose, red lips, face paint, tall, running toward viewer, photorealistic, 8k - and you want just the facial-feature segments for a separate prompt. This node does exactly that: give it a list of concepts and it returns every comma-segment that mentions one of them, re-joined with a delimiter you choose. It's a tiny filter, and it's shockingly handy once you're doing multi-pass or regional prompting on tag-based models.

    How it works

    Mechanically it's three steps, all case-insensitive:

    1. Split the text on commas into segments and trim whitespace.
    2. Split your concepts on newlines and commas (so "eyes\nnose" works as well as "eyes, nose") and lowercase them.
    3. Keep any segment that contains at least one concept, then join the survivors with delimiter (default ", ").

    The example from the README: concepts eyes / nose / lips / face against the clown prompt above yields beautiful eyes, big blue eyes, wearing big red clown nose, red lips, face paint. Order follows the source text, and the delimiter is whatever you set, so you can emit \n if you want a block structure for tag-style prompting.

    The inputs

    Only three, all required:

    • text - the comma-separated prompt you're filtering.
    • concepts - what to look for, separated by commas and/or newlines.
    • delimiter - how to join the matching segments.

    One output: extracted_text, a STRING you can wire straight into a CLIP Text Encode or into another text node.

    Where people get burned

    The matching is a substring check, not a whole-word one. Concept eyes matches beautiful eyes - but it also matches eyeshadow, and look matches looks and looking. That's usually what you want for tag-ish filtering, and it's also how you accidentally keep a segment you meant to drop. If a concept matches nothing, it just contributes nothing; the whole output can come back empty, which will happily feed an empty positive prompt into your sampler. Don't be shy about a Show Text node on the output while you dial in your concept list.

    The other thing to know: it only splits on commas. If your source prompt is one giant paragraph with no commas, the whole thing is one segment and the node is useless on it. This is a tag-prompt tool, so feed it comma-separated booru-style text (the natural form for SDXL-lineage tag models) and it'll behave.

    Installing it

    It's part of the Ichis pack - you get all the ICHIS nodes at once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ichabodcole/ComfyUI-Ichis-Pack
    

    Restart ComfyUI, or search for ComfyUI-Ichis-Pack in ComfyUI Manager. It's pure string handling: no models, no downloads, no Python deps beyond what ComfyUI already has.

    Where it fits

    The classic pattern: build one rich master prompt, then use Extract Tags to pull out the detail segments and feed them to a second, detail-focused CLIP encode - or use it to build a negative prompt from the parts of a positive you want to keep out of the frame. It teams up naturally with ICHIS Text Selector, which picks which variant prompt you're working from in the first place.

    CategoryICHIS

    Inputs (3)

    NameTypeDefaultDescription
    textSTRING
    conceptsSTRING
    delimiterSTRING,

    Outputs (1)

    NameTypeDescription
    extracted_textSTRING