Nodes/ComfyUI-LZNodes/LZ Tag Editor
ComfyUI Node

LZ Tag Editor

Ten named tag slots with per-tag strength and on/off

By liz-ils·Created 7 months ago·Updated 12 days ago· 1
LZ Tag Editor
    • string
    input_string
    tag1_name
    tag1_strength1.00
    tag1_onofftrue
    tag2_name
    tag2_strength1.00
    tag2_onofftrue
    tag3_name
    tag3_strength1.00
    tag3_onofftrue
    tag4_name
    tag4_strength1.00
    tag4_onofftrue
    tag5_name
    tag5_strength1.00
    tag5_onofftrue
    tag6_name
    tag6_strength1.00
    tag6_onofftrue
    tag7_name
    tag7_strength1.00
    tag7_onofftrue
    tag8_name
    tag8_strength1.00
    tag8_onofftrue
    tag9_name
    tag9_strength1.00
    tag9_onofftrue
    tag10_name
    tag10_strength1.00
    tag10_onofftrue

    Hand-editing a booru prompt to bump one tag's weight or delete another is fiddly - and with weights you're juggling parentheses and colons while the whole thing stays unreadable. LZ Tag Editor gives you ten named slots, each with its own tagN_name, tagN_strength, and tagN_onoff toggle, and rebuilds the prompt string for you. Type a tag, set a strength, flip it off when you don't want it, and the output stays clean.

    For Illustrious, NoobAI, Pony, and every danbooru-tag model, this is the comfortable way to work: the model wants comma-separated tags with occasional weight emphasis, and the editor turns that into a spreadsheet-like form instead of a wall of text. The KB's prompt-engineering doc makes the case that tag-based models reward exactly this discipline - quality tags, sensible strengths, no stray characters.

    How the output is built

    The source is straightforward: for each slot from 1 to 10, it takes the name, and:

    • if tagN_onoff is off, the tag is skipped entirely;
    • if strength is exactly 1.0, the tag is emitted bare;
    • otherwise it's wrapped as (tagname:strength).

    Slots are processed in order and the loop stops at the first empty name - so slot 1, 3, 5 with 2 and 4 blank produces only tags 1, 3, 5. Empty middle slots are fine; a blank slot 1 leaves you with an empty prompt.

    Inputs and a couple of gotchas

    • input_string (required) - a string input. Here's the honest quirk: the node parses it for (tag:strength) pairs, but the actual output is rebuilt entirely from the ten slots. So input_string behaves more like a scaffold / reminder of what's in play than the source of truth. The slots are the real controls - if you change a tag in the input box expecting it to flow through, it won't. Put your tags in the slots.

    Two more things worth knowing. First, the output joins tags with a bare comma, no space (",".join). Most booru models don't care, but if you're feeding an encoder that does, pipe the result through a replace or concat to add spaces back. Second, tagN_strength is configurable up to 100, but that's a UI range, not a recommendation - practical CLIP weights live around 0.5–1.5, and past ~1.5 you're stacking distortion. Treat the upper range as "for your experimentation."

    And the CLIP-model caveat applies here too: (tag:strength) syntax is inert on LLM-encoded models (Anima, Flux, Z-Image), where it becomes literal punctuation. On those, keep every strength at 1.0 (which emits bare tags) or skip the editor.

    Installing it

    Same pack, same install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/liz-ils/ComfyUI-LZNodes
    

    Restart ComfyUI, or Manager → search "ComfyUI-LZNodes". No extra dependencies, no model downloads.

    If you don't need the per-slot toggles and just want a blanket weight applied to everything, LZPromptWeight in the same pack is the simpler tool - it wraps an entire comma-separated prompt with one default weight.

    CategoryMyCustomNodes/Text

    Inputs (31)

    NameTypeDefaultDescription
    input_stringSTRING
    tag1_nameoptSTRING
    tag1_strengthoptFLOAT1.000–100
    tag1_onoffoptBOOLEANtrue
    tag2_nameoptSTRING
    tag2_strengthoptFLOAT1.000–100
    tag2_onoffoptBOOLEANtrue
    tag3_nameoptSTRING
    tag3_strengthoptFLOAT1.000–100
    tag3_onoffoptBOOLEANtrue
    tag4_nameoptSTRING
    tag4_strengthoptFLOAT1.000–100
    tag4_onoffoptBOOLEANtrue
    tag5_nameoptSTRING
    tag5_strengthoptFLOAT1.000–100
    tag5_onoffoptBOOLEANtrue
    tag6_nameoptSTRING
    tag6_strengthoptFLOAT1.000–100
    tag6_onoffoptBOOLEANtrue
    tag7_nameoptSTRING
    tag7_strengthoptFLOAT1.000–100
    tag7_onoffoptBOOLEANtrue
    tag8_nameoptSTRING
    tag8_strengthoptFLOAT1.000–100
    tag8_onoffoptBOOLEANtrue
    tag9_nameoptSTRING
    tag9_strengthoptFLOAT1.000–100
    tag9_onoffoptBOOLEANtrue
    tag10_nameoptSTRING
    tag10_strengthoptFLOAT1.000–100
    tag10_onoffoptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    stringSTRING