โป Loop (โ๐๐ ฐ๏ธ Advanced Write Text)
Expand {red|blue|green} into every combination, not just one
- texts
Bjornulf's pack has an "Advanced Write Text" node that lets you write photo of a {red|blue|green} car and have it randomly pick one color each run - classic wildcard-prompt syntax. Loop Write Text takes that exact same curly-brace syntax and does the opposite of random: instead of picking one combination, it expands every possible combination and runs all of them, in one Queue click. Write {red|blue|green} car once, get all three cars generated without touching the node again.
How it works
You write your text using the same bracket syntax as the pack's Advanced Write Text node - {option1|option2|option3} for a set of choices anywhere in the string, and <name>-style variables if you need to keep a value consistent across the text. Where Advanced Write Text rolls a die and picks one, Loop Write Text enumerates the full combinatorial set and hands it off as a list. Under the hood that's the same trick as the pack's plain Loop Texts node: a STRING list output, which ComfyUI's execution engine automatically re-runs everything downstream against, once per item, all inside a single prompt. Stack a couple of {a|b} groups in the same string and the combinations multiply fast - three groups of three options is 27 full runs from one click, so it's worth doing the multiplication in your head before you hit Queue on an expensive checkpoint.
It's also flagged as an output node, which just means ComfyUI treats it as a node with a visible effect worth always executing - in practice it also prints what it generated to the ComfyUI console, handy for confirming you actually got the combinations you expected before the whole batch runs.
The inputs and outputs that matter
text- the multiline field where you write your prompt with the{a|b|c}syntax. This is the only thing you have to fill in.variables(optional) - lets you feed in the same variable-reuse mechanism the Advanced Write Text node supports, so a value picked once can be referenced again later in the same string instead of being re-rolled.texts- the output: a list of every expanded string, fanned out one per downstream execution.
How to install it
Grab it through ComfyUI Manager by searching Bjornulf_custom_nodes, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
cd in and run pip install -r requirements.txt (ideally inside a venv), then restart ComfyUI. Windows portable users run the equivalent pip install with the embedded python.exe.
Common issues
The main trap is scale, not bugs: because this node expands every combination rather than sampling from them, a prompt with several bracket groups can silently balloon into dozens of full generations from a single click - if your workflow suddenly takes forever after adding one more {a|b|c} group, that's expected behavior, not a hang. Count your combinations before you queue anything with a slow checkpoint attached.
Beyond that, this is one of the pack's text-syntax nodes, so it inherited a real breaking change in the project's history: the author rewrote the write/show text nodes at one point specifically because the old syntax was getting unwieldy, and newer syntax additions (percentage weights like {A(80%)|B(15%)|C(5%)}, and grouped no-duplicate picks) only landed in later pack releases. If a {...} syntax you copied from a tutorial doesn't parse, update the pack first before assuming you typed it wrong.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | โ | |
| variablesopt | STRING | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| texts | STRING | โ |