Text Mux (AI / Manual)
The boring AI/manual prompt switch that keeps your workflow alive
- text
TextMux is the unglamorous node that makes an LLM-powered workflow actually pleasant to use. It's a three-input switch: it takes an AI-generated prompt on one wire, your own typed text on another, and a source dropdown that decides which one flows out. Feed the output to your CLIPTextEncode positive and you get one-click control over whether the AI writes the prompt or you do - no rewiring the graph every time the LLM gets it wrong.
It ships in the comfyui-prompt-tools pack, and in the pack's own demo workflows it's the standard wiring: PromptHelper → TextMux → CLIPTextEncode. The pattern makes sense once you've used an LLM enhancer for a while - the AI nails the structure but misses the mood, or you want to lock in a prompt you know works while the model keeps trying new variations on the other wire. TextMux is how you keep both paths alive instead of picking one and losing the other.
How it works
It does almost nothing, and that's the point. No LLM, no API key, no config file, no pyyaml requirement. Internally it's a tiny switch with one genuinely smart behavior: if source is "AI (PromptHelper)" but the incoming ai_text is empty, it silently falls back to manual_text instead of emitting nothing. A failed or empty LLM call upstream won't break your queue - you get your manual fallback text instead of a dead string feeding the encoder. When source is "Manual", it just passes manual_text through.
That fallback is easy to miss and easy to love. Plenty of similar switches will happily pass an empty string into your sampler and hand you a grey mush of a render. TextMux refuses to do that.
The inputs that matter
source- dropdown, default "AI (PromptHelper)", the other option "Manual". This is the thing you flip while iterating.manual_text- your override, multiline. This is what you actually type.ai_text- optional, and it'sforceInput, so it only takes a wired connection from another node (PromptHelper, VisionPromptHelper, a text file reader, whatever). You won't be typing into this field.
One output: text, a plain STRING. Wire it straight into CLIPTextEncode positive (or negative, if you're routing a negative-prompt generator through the same switch).
Installing
Same pack, same install - there's nothing extra to configure for this node specifically. ComfyUI Manager, search comfyui-prompt-tools, or:
cd /path/to/ComfyUI/custom_nodes
git clone [email protected]:wernerberHH/comfyui-prompt-tools.git
Restart. It works even if you skip pyyaml and never configure a single engine - TextMux has no idea an LLM exists, and it doesn't need to.
Common issues
Honestly, there aren't many, because it can't fail in interesting ways. The gotchas are expectations, not bugs: flipping source to "Manual" fully ignores the AI text, so don't expect a blend - it's one or the other. And the fallback cuts both ways: if your AI output is empty and you didn't write any manual_text, you still get an empty string. It can't resurrect a prompt that was never written. One more thing worth knowing: the node doesn't trim or cache - the AI text you wire in is passed through as-is, so pair it with a ShowText node if you want to eyeball the AI's latest attempt before deciding it's the manual text that runs.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| manual_text | STRING | — | |
| source | COMBO | AI (PromptHelper) | 2 options: AI (PromptHelper), Manual |
| ai_textopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |