ComfyUI Node

Toggle Tags

Toggle Tags

By craftgear·Created 8 months ago·Updated 6 months ago· 1
Toggle Tags
    • text
    text
    excluded_tags[]

    Say Load LoRAs With Tags hands you a character LoRA's full list of trigger words, or you've got a prompt where you're not sure school uniform is helping or hurting. Toggle Tags renders every tag in the input as a clickable chip right on the node. Click a tag and it gets struck through and dropped from the output; click again to bring it back. No editing the prompt text, no rebuilding the string - you're A/B testing by clicking.

    It's an output node, so it runs and shows its result even when nothing consumes the output. That's the right call for something whose whole job is letting you stare at tags while you experiment.

    How it works

    Mechanically it's almost embarrassingly simple, which is the appeal. The input text (socket-only) is split on commas into tags. The set of tags you've disabled is persisted in a hidden-ish excluded_tags widget - stored as a JSON array, default []. Enabled tags are re-joined with ", " and output. The UI paints disabled tags with a strikethrough and semi-transparency, and shows "(empty)" when there's no input.

    One nicety shared across this pack: kept tags get their parentheses escaped, so a tag like (cute) comes out as \(cute\) and CLIP reads it as a literal tag instead of an attention weight. Weighted tags like (cute:1.3) are left intact.

    Inputs and outputs that matter

    • text - comma-separated tag string, and it must come over a wire (forceInput). The classic source is the tags output of Load LoRAs With Tags, but any prompt text works.
    • excluded_tags - the disabled set. It's a widget, but it's persisted JSON; you usually never touch it because the click UI manages it.

    Output: text, only the enabled tags. Chain: Load LoRAs With Tags → tags → Toggle Tags → text → CLIP Text Encode, and you're choosing triggers live at generation time.

    Install

    Search craftgear in ComfyUI Manager and install a numbered version (the README warns nightly fails on security restrictions), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/craftgear/comfyui-craftgear-nodes
    

    Restart ComfyUI. No models, no extra pip packages.

    Where people get burned

    • You can't type into it. text is forceInput, so an unconnected Toggle Tags just shows "(empty)". If you want a clickable toggler that starts from text you type, chain it after Commentable Multiline Text or Join Texts instead.
    • It toggles whole tags, not characters. Tags split on commas - a tag containing a comma is really two tags. Fine for normal prompt discipline, surprising if you paste something with commas inside quoted phrases.
    • Disabling doesn't remove the token from the encoder. The excluded tags simply aren't in the output string, so they're gone from what CLIP sees. That's exactly what you want; just don't expect a "disable" that keeps the tag visible to the model - that's a different trick (negative prompt), not a toggle.
    Categorycraftgear/text

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    excluded_tagsSTRING[]

    Outputs (1)

    NameTypeDescription
    textSTRING