Pre_Translate_prompt
Strip the [brackets] out of your scene prompts
- STRING
Pre_Translate_prompt is the smallest node in the ComfyUI_StoryDiffusion pack, and it does one tiny, useful thing: it takes the same [Taylor] ...-style scene lines you fed to StoryDiffusion_CLIPTextEncode and strips the markup, returning plain readable captions as a single string.
Why would you want that? Because the pack's prompt format is load-bearing for generation but useless anywhere else. [Taylor] wake up in the bed ; with [NC] markers and # comments is exactly what the encoder needs to assign scenes to characters - and completely wrong when you want to show the captions under the finished panels, feed them into Comic_Type, or hand the text to a translation step. This node is the bridge: one input, one output, no models, no VRAM.
Inputs
scene_prompts- aSTRING(it's markedforceInput, so it takes a wire from a text box or another node). Paste or connect your scene lines.keep_character_name- a boolean, default off. With it off, the node drops the[Taylor]-style role prefix entirely. With it on, it keeps the name and just removes the brackets - useful if you want the character named in the caption.
Output
STRING - the cleaned captions joined into one string, each scene on its own line.
What gets removed: [RoleName] prefixes (or just their brackets if you keep names), [NC] markers, anything inside parentheses when names are dropped, and # comment suffixes - so [Taylor] wake up in the bed # morning scene becomes just wake up in the bed.
How it fits
The typical chain: your scene_text goes into StoryDiffusion_CLIPTextEncode for generation and into Pre_Translate_prompt at the same time; the cleaned output flows to Comic_Type's scene_prompts so your panels get captions that don't look like someone left debug tags in. Note that Comic_Type also does its own internal cleanup - this node is mainly for when you want the cleaned text earlier in the graph, or you're piping prompts somewhere that can't handle brackets (a translation node, a text file writer, a prompt to another model).
Install
Same pack install as everything else here - there are no per-node extras:
cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_StoryDiffusion.git
cd ComfyUI_StoryDiffusion
pip install -r requirements.txt
Honest take: it's a convenience helper, not a headline feature. If you never need clean copies of your scene prompts, you can skip it entirely and nothing in the pack complains. But it's free, it's zero-risk (a string transform can't break your generation), and if you're doing the full story-to-comic workflow it removes a fiddly manual step. Keep keep_character_name off unless you genuinely want names in your captions - the plain version reads like a real comic.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| scene_prompts | STRING | — | |
| keep_character_name | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |