Nodes/tag_prompt/Tag Prompt
ComfyUI Node

Tag Prompt

A real editor for your multi-line prompt, not a text box

By yossq236·Created 7 months ago·Updated 5 months ago· 1
Tag Prompt
    • STRING
    ◄text—►

    The name undersells it. "Tag Prompt" sounds like another text box that does nothing, and the backend half genuinely is one - but the frontend half is a full prompt editor bolted onto your graph, with syntax highlighting, line numbers, a header outline, and autocomplete off a ~277,000-entry tag list. If you keep your prompts as long, structured blocks with # section headers and comments (the block pattern that's been winning on everything SDXL-derived and most LLM-encoded models), this is the node that makes that habit not miserable. You write in a real editor, and the graph only ever sees the clean text.

    What it actually does

    The node is one value in, one string out. Behind the scenes it does three quiet jobs:

    • Comment stripping. Any line starting with # or // is dropped, and /* ... */ blocks are removed even across lines. That's your whole organization scheme - headers, notes, disabled candidates - gone before the text ever reaches a CLIP encoder.
    • Blank-line cleanup. Empty lines are collapsed, so a "section break" you type as whitespace doesn't become a stray newline in your conditioning.
    • JSON unwrapping. If the whole text parses as JSON with a text field, it pulls just that field out. That's the structured-prompt trick from the LLM-encoded world: you can keep {"composition": ..., "text": "..."} in the editor and ship only the prompt sentence downstream.

    There's a nice caching detail buried in the source: the node fingerprints the cleaned text, not what you typed. Edit a # comment or rearrange blank lines and the hash doesn't move, so ComfyUI won't re-encode and re-queue the graph for a change that doesn't matter. That's the kind of care you don't expect from a brand-new utility node.

    The editor itself is where the "prompt" part of the name earns out. Start typing and it suggests danbooru-style tags from an embedded list - underscores get converted to spaces and parens escaped as it fills, which is exactly the long_hair → long hair rule that keeps biting people on Pony/Illustrious/NoobAI. (tag:1.2) weights highlight, # lines become clickable section headers in a mini outline, and everything runs through a background worker so a 270k-entry tag list doesn't make the graph UI crawl.

    The inputs that matter

    There's exactly one required input, text - a multiline string. You can also paste in a JSON object with a text key and it'll extract that field. The single STRING output wires straight into a CLIP Text Encode's text input: right-click the encoder's text widget, choose Convert widget to input, and connect. If you're running an LLM-encoded model (Z-Image, Anima, Flux 2 Klein) the same output feeds its prompt input the same way.

    Installing it

    This is the easiest install you'll ever do - zero models, zero torch deps, zero pip packages. The backend is pure Python and the editor JS ships prebuilt in the repo. Either:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yossq236/tag_prompt
    

    then restart ComfyUI, or just search "tag_prompt" (or "Tag Prompt") in ComfyUI Manager and hit install.

    Where people get burned

    This is a new node - one commit, May 2026, no real community footprint yet - so don't expect a support scene, and don't assume bug reports are "you problems." A few gotchas worth knowing before you lean on it:

    • It needs a recent ComfyUI. The backend uses the new comfy_api extension API, so an old 0.x install will just fail to load it.
    • Comment syntax is aggressive. # and // kill the rest of the line anywhere, so don't put a # inside a tag you actually want.
    • Malformed JSON fails silently - it falls back to treating your raw text as the prompt, which is usually what you want but can hide a typo.
    • If you run a frontend that doesn't load web extensions, you get a plain text box. The node still works; you just lose the editor.

    Worth grabbing if you've outgrown the stock multiline box and want one authoritative, well-organized prompt feeding every encoder in the graph.

    Categoryutils

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING—

    Outputs (1)

    NameTypeDescription
    STRINGSTRING—