Prompt Generator (Smart Input)
Turn one good prompt into five variations
- prompt
You've got a prompt that works, and you want more in the same vein - same subject, same style, different camera angle or composition. Hand-typing "wide shot," "close-up," "low angle" versions gets old fast. That's the whole job of Prompt Generator (Smart Input): you paste a prompt you like, it asks an LLM to rewrite it, and hands you back the variations.
It's one of three nodes in the AI_Text_Comfyui pack by Zch6111, and honestly it's the most approachable of the three. The author's own description is exactly right: "Rewrites a prompt with the same style but different angles or views." No image input, no hidden pipeline - just prompt in, prompt batch out.
How it works
Under the hood it's a single call to an OpenAI-compatible chat API. The node builds a system message telling the model to keep the subject, character, object, and style identical and only vary composition, angle, camera view, or minor context, then sends your prompt_input as the user message with a temperature of 0.7.
The model replies with several line-separated versions. The node splits that reply on newlines and keeps the first num_prompts of them, joined back into one string. That last detail is the one that trips people up, so file it away: the output is a multi-line string, not a single prompt. You're getting a batch.
The inputs that matter
Four inputs, and only three of them deserve your attention:
- api_key - default is the placeholder
sk-xxx, which will error until you paste a real key. The key lives in the widget, so it gets saved into your workflow JSON - keep those files private. - model -
gpt-4o(default),gpt-4, orgpt-3.5-turbo. gpt-4o is the sensible default; the older ones are there if you're cheap or on a proxy that only serves them. - num_prompts - default 5, range 1–100. How many variations you want back.
- prompt_input - the prompt you're varying. That's the whole game.
Output is a single prompt (STRING) containing your variations, one per line. To feed them into a sampler individually you'll need a node that splits on newlines; if you just want to eyeball a few options, one pass through this node is plenty.
Install
This is the easiest install in the pack - there's nothing to download. No requirements.txt, no model files, no pip step; it only uses Python's standard library plus PIL/numpy/torch that ComfyUI already ships.
cd ComfyUI/custom_nodes
git clone https://github.com/Zch6111/AI_Text_Comfyui
Restart ComfyUI, and the node shows up as Prompt Generator (Smart Input) under the flux/prompt category. Or skip the terminal: open ComfyUI Manager → Install Custom Nodes → search AI_Text_Comfyui → install → restart.
Gotchas worth knowing
The category says flux/prompt, but nothing here is Flux-specific - the node writes natural-language sentences, which is exactly what Flux's T5 encoder wants (sentence-style prompting over tag soup), and it works fine on any model that takes a positive prompt. It's a generator, not a gatekeeper.
Two real things to flag. First, the "Smart Input" node and the pack's Auto Step sibling both send their API calls to https://openai-api.codejoyai.com:8003/openai/v1/chat/completions - a third-party OpenAI-compatible relay, not api.openai.com. That's the author's choice, it works, but it means the key you type is going to a proxy you don't control. Use a throwaway key or skip the pack if that bothers you. Second, the README tells you to re-set the key after restarting your terminal - widget values persist in saved workflows, but if you build fresh each session, be ready to paste it again.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | sk-xxx | — |
| model | COMBO | 3 options: gpt-4o, gpt-4, gpt-3.5-turbo | |
| num_prompts | INT | 51–100 | — |
| prompt_input | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |