FP Text Clean And Splitt
Comment lines out, AR regions in — FP Text Clean And Splitt does the boring parsing
- all_expt_comments
- all_expt_areas
- ar_list
- impact_wildcard
Regional prompting in ComfyUI has an ergonomics problem: you end up with one big text block where commented-out lines and <AR1>...</> region tags sit in the same soup, and you have to keep the main prompt clean by hand. FP Text Clean And Splitt (yes, two t's - the name is a typo that made it into production) is the parser that does it for you. Feed it raw text, get back clean main text, five separate region strings, and an Impact Pack wildcard. It's the utility that makes the Folded Prompts editor's tree mode output actually usable, and it works on any text you paste in, not just text from that pack.
What it actually does
Pure Python, no AI, no models. The pipeline is easy to follow:
//-prefixed lines are treated as comments and stripped. The prefix is read from your ComfyUI settings underkeybinding_extra.comment_prefix- whatever you set the pack's line-comment shortcut to (default//), this node honors.<AR1>...</>through<AR5>...</>blocks are detected. The closing tag is</>- that's the whole convention, no need to rename closers.
You get four outputs, each a different "view" of the same text:
all_expt_comments(STRING) - comments removed, AR tags stripped but their content kept, blank lines collapsed, and every tag reformatted to end with a comma. This is your main prompt, ready for CLIP Text Encode.all_expt_areas(STRING) - the same cleaning, but AR blocks are removed entirely, tags and content. For when you want the base prompt with no regions at all.ar_list(LIST) - one entry per region, AR1 through AR5 in order, cleaned and flattened; regions you didn't use come back asNone.impact_wildcard(STRING) - the same regions reformatted as an Impact Pack wildcard: a[LAB]line followed by[AR1].../[AR2]...lines, ready to drop into Impact Pack's wildcard node so a workflow can pick regions dynamically. Impact Pack quietly owns most of the ecosystem's wildcard machinery, so this output is the "send it downstream" path.
Inputs are simple: text (your multiline prompt), plus optional before_text and after_text that get concatenated around it before parsing.
Install
Same deal as the rest of the pack - no models, no dependencies beyond the Python stdlib:
- ComfyUI Manager → Install, search Folded prompts, install, restart.
- Or manually:
then restart.cd ComfyUI/custom_nodes git clone https://github.com/akawana/ComfyUI-Folded-Prompts.git
Common gotchas
Commented lines not disappearing? Your comment prefix isn't // - check Settings → Keybinding Extra, since this node reads that exact setting and honors a custom prefix.
Only AR1–AR5 and <ALL> are recognized. There's also an <ALL> tag whose content gets prepended to every region in ar_list - useful as a shared base like 1girl, masterpiece that applies to all regions at once.
And the None entries in ar_list: don't feed them to a node that chokes on nulls. The Impact Pack wildcard output is the safer route when you want regions consumed downstream. For anyone hand-writing regional prompts, this turns a fiddly regex habit into one node.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| before_textopt | STRING | — | |
| after_textopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| all_expt_comments | STRING | — |
| all_expt_areas | STRING | — |
| ar_list | LIST | — |
| impact_wildcard | STRING | — |