Tag Prompt Builder
Your anime prompt, built from dropdowns instead of memory
- Positive Prompt
Every time you fire up an anime checkpoint you retype the same boilerplate: masterpiece, best quality, absurdres, 1girl, solo, the lighting, the pose, the background. Tag Prompt Builder (class UniversalTagPromptBuilder) is the ComfyUI node that stops you doing that by hand. It's a dropdown-driven prompt assembler: ten pickers for the categories you always set, one free-text box for the stuff that's actually specific, and a single string out the other end that plugs straight into your CLIP Text Encode.
A quick reality check, because the name suggests more magic than there is. This node calls no API, needs no key, and never touches weights or embeddings. It is a string joiner with good taste: it arranges your tags in a sensible order and joins them. That's the right job, because order genuinely matters on tag-based models - earlier tokens get stronger attention, which is exactly why the node puts technical tags first and the background dead last.
Where it's meant to live is anywhere CLIP is doing the encoding: Pony, Illustrious, NoobAI, WAI, plain SDXL - all the Danbooru-vocabulary models. It ships tuned for the Illustrious/NoobAI quality convention (masterpiece, best quality, absurdres is the default Quality pick). If you're on Pony, you'll want to edit prompt_tags.json to swap in score_9, score_8_up instead, since Pony runs its own score-tag system. And natural-language models like Flux? Wrong tool. The dropdowns are Danbooru-shaped, and feeding that vocabulary to a model that wants prose quietly degrades output rather than failing.
How it works
The node reads a config file, prompt_tags.json, sitting in the same folder as the Python. Each category in that file becomes a dropdown in the node. On generate, it walks the categories in a fixed order - NSFW, Quality, Style, Character, Pose, Camera, Lighting, Time, Expression, then your Custom text, then Background - skips anything set to none, and joins what's left with your separator. That's the entire mechanism, and the source confirms it.
Two details worth knowing. First, the category order is baked into the code, not the JSON, so rearranging the file won't reorder your prompt. Second, there's a small quirk: Custom lands before Background. So if you write "standing in a garden" in Custom and also pick outdoors, your description reaches the encoder first. Harmless - it even matches the common "background last" habit - but it explains the output ordering if it ever looks odd.
The inputs that matter
You don't need to touch all ten every run. Realistically you'll set:
- Quality - the quality-tag prefix. The default is the Illustrious/NoobAI standard and a perfectly good starting point.
- Character -
1girl, solo,2girls,1boy, solo. People forget this category and the model notices. - Custom - the one honest free-text field, and where your actual subject goes: "long hair, blue eyes, school uniform, looking at viewer". Everything else is scaffolding.
- separator - the string between groups, default
", ". Leave it alone unless you want newlines. - newlines - a boolean that puts each category on its own line so you can read and debug the assembled prompt before it hits the encoder.
The single output is a STRING named Positive Prompt, wired into the CLIP Text Encode positive input.
Installing it
No dependencies, no model downloads, nothing heavy. In ComfyUI Manager, search ComfyUI-PromptTagBuilder (or "Tag Prompt Builder"), hit install, restart. Or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/Cordux/ComfyUI-PromptTagBuilder
then restart ComfyUI. The pack's requirements.txt is empty - the node only uses Python's stdlib - so there's no pip step and no dependency hell to fight. Refreshing for once.
Common issues
- Dropdowns empty, or the node misbehaves on load: the JSON failed to parse or vanished. The node falls back to its built-in defaults and prints
Config load failed... Falling back to defaultsto your console. Fix the file (jsonlint.com catches a stray comma in seconds) and restart. - Edited the JSON and nothing changed: the file is read at startup, so a full restart is required every time. That's the #1 gotcha with this pack.
- Want a new category? Adding options to an existing dropdown is a JSON edit. Adding a whole new dropdown means editing
tag_prompt_builder.py- the README is upfront about it.
One honest caveat: this is a small, quiet pack with essentially no community footprint - the other node in it sits at roughly zero search impressions. It does one thing well and costs you nothing to try. Treat prompt_tags.json as the real product: spend your first hour replacing the presets with the exact tags you already type by muscle memory. That's the moment it stops being a novelty and starts saving you keystrokes.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| NSFW | COMBO | none | 4 options: none, nsfw, explicit, nsfw, nsfw, suggestive |
| Quality | COMBO | masterpiece, best quality, absurdres | 9 options: none, masterpiece, best quality, masterpiece, best quality, absurdres, masterpiece, best quality, absurdres, highres, best quality, high quality, high quality, +3 |
| Style | COMBO | none | 11 options: none, anime, realistic, semi-realistic, chibi, sketch, +5 |
| Character | COMBO | 1girl, solo | 14 options: none, 1girl, solo, 1boy, solo, 2girls, 2boys, 1girl, 1boy, +8 |
| Pose | COMBO | none | 13 options: none, standing, sitting, lying down, kneeling, walking, +7 |
| Camera | COMBO | none | 11 options: none, close-up, portrait, upper body, cowboy shot, full body, +5 |
| Lighting | COMBO | none | 11 options: none, natural lighting, soft lighting, dramatic lighting, backlighting, rim lighting, +5 |
| Time | COMBO | none | 9 options: none, day, night, dawn, dusk, sunset, +3 |
| Background | COMBO | none | 24 options: none, simple background, white background, black background, grey background, transparent background, +18 |
| Custom | STRING | long hair, blue eyes, smile, looking at viewer | — |
| Expression | COMBO | none | 13 options: none, smile, grin, smirk, laughing, blushing, +7 |
| separatoropt | STRING | , | — |
| newlinesopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Positive Prompt | STRING | — |