Prompt Commenter
Keep Every Prompt Variant in One Box — Comment the Ones You Don't Want
- prompt
You know the drill: you keep three versions of a prompt in a notepad file and paste whichever one you're testing into the encoder, deleting the others so they don't leak in. Prompt Commenter is the node that makes that habit unnecessary. It reads a prompt, strips out anything you've "commented out," and outputs the clean remainder. You keep all your variants in one multiline box and switch between them by adding or removing a # - no pasting, no deleting, no losing the version you didn't pick.
The comment syntax (this is the whole node)
The prompt field accepts several comment styles, straight from the author's own tooltip:
# tag, tag- whole line ignored// tag, tag- whole line ignored` tag, tag- whole line ignored (yes, a backtick also comments - watch for that if your text legitimately starts with one)/* tag, tag */- block comment, multiline allowed[name]- a section header# [name]or` [name]- the entire section until the next header is skipped
Mechanically it's a small line-walker: it strips /* */ blocks first, then walks line by line, skipping commented lines and any section under a commented header. At the end it joins the survivors with ", " and cleans up stray commas.
The good use case
This is a genuinely nice fit for SDXL-lineage tag prompting, where quality tags and variant lists live comfortably as comma-separated items (see the KB's tag-prompting notes). Use it to:
- A/B test a tag:
# blue eyes,vsclosed eyes,- flip the#to switch, keep both forever. - Park alternate style blocks under
# [style]headers and re-enable them when needed. - Keep a library of negative-prompt candidates in the same box, most commented out.
Where it bites
- It flattens everything to comma-separated tags. Comment lines and section headers are stripped, and the survivors get joined with commas. On LLM-encoded models - Z-Image, Anima, Flux 2 Klein - that forced comma structure fights the "read my prompt as an instruction" behavior those encoders want. Great for tag models, mediocre for sentence models.
- Section headers don't survive.
[face]is used only to mark where a section starts; it doesn't reach the encoder. The structure is for you, the output is flat. - Comment markers are line-strict. A
#in the middle of a line isn't a comment; the prefix has to start the line. And because`is a comment marker, you can't begin a line with a backtick on purpose.
Inputs, output, install
One input - prompt (multiline) - one STRING output named prompt, ready for a CLIP Text Encode or another prompt node. Category Kyusu/prompt. Pure Python, no dependencies:
cd ComfyUI/custom_nodes
git clone https://github.com/TaIIo4KuH/kyusu-nodes
or ComfyUI Manager → "Kyusu Nodes", restart.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | beautiful woman, long hair, # open eyes, blue eyes, closed eyes, elegant dress [face] sharp features, defined jawline # [extras] detailed background, bokeh | Comment syntax: # tag -> line ignored // tag -> line ignored ` tag -> line ignored /* tag */ -> block ignored [name] -> section header # [name] -> whole section skipped ` [name] -> whole section skipped |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |