Free Prompt Optimizer
A free LLM rewrites your prompt — no API key, no GPU
- optimized_prompt
Stuck on a prompt that comes out flat, or typing in your native language and tired of mangling it into English first? This is the node that fixes both at once, for free. ComfyUI's Free Prompt Optimizer (node class PromptOptimizer) from the one-file pack ciga2011/ComfyUI-PromptOptimizer takes whatever you typed and has an LLM rewrite it into a longer, more vivid description built for text-to-image models. It ships a single node with a grand total of two inputs. There is nothing else in the pack, which is honestly kind of the point.
What it actually is
This is the "LLM-assisted prompting" trend that's gone from a browser-tab habit to a node on your graph - prompt-enhancer chatter has roughly doubled every year in the community since 2023. What makes this one different from the local packs people now ship per-model-family is that it does the work remotely. The name says "free," and it means it: there's no local model, no API key, no account, no queue. The whole thing is a requests.post to Pollinations' free text endpoint.
That's also the entire install story - requirements.txt is empty, because the only dependency is requests, which ComfyUI already ships. You don't download a gigabyte of weights for this.
How it works
Feed it a prompt and the node sends two things to text.pollinations.ai: your prompt, and a long system instruction titled "Image Prompt Diversification." Read that instruction and it tells you exactly what you're getting - it translates non-English prompts to English, invents setting/colors/lighting/mood, expands any artist or style reference you mention, and forces varied vocabulary so two runs don't come back near-identical. The request carries your seed and asks for the openai model, and the response text comes back as the output. "A beautiful sunset over the mountains" in, a paragraph about "a breathtaking twilight spectacle" out. That's the whole mechanism.
The inputs that matter
There are only two, and you'll set one of them and maybe touch the other:
prompt(multiline string, default "A beautiful sunset over the mountains") - your raw idea. Non-English is fine, that's the point.seed(int, 0 to 9999999999, default 0) - passed straight to the API, so keeping it fixed gives you the same rewrite back and lets you A/B your own prompt wording honestly. Bump it when you want variety; the system prompt is engineered to give you different phrasing each time.
The single output, optimized_prompt (string), plugs straight into a CLIP Text Encode node's text input (or the Flux variant) in place of your original positive prompt.
Installing it
ComfyUI Manager → search "ComfyUI Prompt Optimizer" (the pack title) → install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/ciga2011/ComfyUI-PromptOptimizer
Restart ComfyUI and the node appears in the list as "Free Prompt Optimizer." No model files, no heavy deps, nothing to configure. It's genuinely a two-minute setup.
Where people get burned
The big one is reliability, because you've handed a third of your pipeline to a free public endpoint. Pollinations users have been complaining about it being "slow, down, or inconsistent" for a while, and there's no graceful handling on this end: if the API returns anything but a 200, the intended fallback (return your original prompt) doesn't run - the error branch assigns to a misspelled variable and the node throws a NameError instead. Network hiccups crash it the same way, since there's no try/except. See a red error box for no obvious reason? That's the free API, not your graph. Re-running usually sorts it.
The other trap is matching the output to your model. This node emits long, natural-language prose, and that's exactly what Flux and the newer LLM-encoded checkpoints want. Feed it to a tag-based SDXL/Illustrious pipeline and you've swapped clean booru tags for a run-on sentence - worse results, not better. And even on the right model, the community's standing advice applies: unedited LLM output is "a recipe for nonsense," and long prompts drift past the attention cap on modern encoders. Use the rewrite as a springboard, then trim.
Two last things. Your prompt text leaves your machine and hits a third-party server - don't paste anything you wouldn't want off-box. And yes, a node that phones home is exactly the thing the ecosystem tells you to be wary of; but this pack is one ~90-line file you can read in a minute, and all it does is that one POST. That's about as auditable as custom nodes get.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A beautiful sunset over the mountains | — |
| seed | INT | 00–9999999999 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| optimized_prompt | STRING | — |