Fallback Text Switch (Creepybits)
The safety net for LLMs that come back empty
- text
Somewhere in almost every workflow that uses an LLM, there's a moment where the AI just... doesn't answer. Rate limits, an empty response, a model that decided today wasn't the day. Fallback Text Switch exists for exactly that moment: if the primary_text input is empty (or only whitespace), it silently swaps in fallback_text instead. Empty in, backup out. That's the whole job, and it does it well.
Why this matters in practice: the whole point of the LLM prompt-engineering nodes in this pack is that a Gemini or Qwen node writes your prompt for you. But a failed API call or a blank generation means an empty string flows downstream - and an empty string is the worst possible prompt. It doesn't fail loudly, it just produces garbage. Fallback Text Switch guarantees that the wiring downstream always sees something.
How it works
Dead simple. The node checks primary_text.strip(). If there's anything left after stripping whitespace, that's what comes out the text output. If not, you get fallback_text. There's no logic table, no condition inputs - just a two-way swap on emptiness. The default fallback_text is literally "Default prompt", which you'll want to replace with a real prompt that roughly matches whatever your LLM was supposed to generate.
Where it fits
The natural wiring: Master Key → Gemini API → Fallback Text Switch → your CLIP text encoder. If Gemini returns nothing, you fall back to a hand-written prompt instead of a blank canvas. It's also handy in template workflows where a user might leave an optional field empty - instead of a gap in the prompt, they get your sensible default.
The one limitation worth knowing: it only checks for emptiness. If your Gemini node fails and returns an error string like API Error: something broke, that's not empty - it's a perfectly valid non-empty string, so it passes straight through and gets encoded into your prompt. If you want a fallback that catches error text too, you'll want a more capable text-router node or a conditional in rgthree-style logic, not this one.
Installing it
It's part of ComfyUI-Creepy_nodes, so you already have it if you installed the pack:
- ComfyUI Manager: search for "Creepy_nodes" and install.
- Manual:
cd ComfyUI/custom_nodes git clone https://github.com/Creepybits/ComfyUI-Creepy_nodes.git
Restart ComfyUI afterwards. This node has zero dependencies beyond what ComfyUI already ships - no model files, no API keys, nothing. It's pure Python string logic.
Troubleshooting
If your output is always the fallback even though you're sure primary_text has content, check that you actually connected something to primary_text and that the upstream node executed. A common beginner trap: connecting a node that's bypassed or errored, so the string is genuinely empty. Also remember the two inputs are plain text boxes you can type into - you don't have to wire either one. That makes it a handy manual override switch: type a prompt into primary_text, leave it empty to use the fallback.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| primary_text | STRING | — | |
| fallback_text | STRING | Default prompt | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |