✨Prompt Enhance
Have an LLM turn your lazy prompt into something a model can actually use
- enhanced_text
If you've ever stared at a reference image and typed woman, forest, cinematic into the prompt box, this node is the fix for your laziness. ✨Prompt Enhance takes whatever half-sentence you actually managed to write and hands it to an LLM, which hands back a proper, detailed prompt. It's the "please make this not garbage" button, and it sits inside the ✨Prompt Assistant pack alongside translate and caption nodes.
One thing up front, because it surprises people: this node doesn't run any model locally. It's an API client. You point it at a cloud LLM (Zhipu's free GLM flash tier is the default) or a local Ollama model, and the expansion happens over HTTP. No weights to download, no VRAM to budget. The pack's only real dependencies are httpx, imageio, and imageio-ffmpeg - light.
How it works
The flow is simple under the hood: your text gets merged with a system-prompt "rule," that pair goes to the chosen LLM service, and the model's reply comes out the single enhanced_text output. You wire that string straight into a CLIP Text Encode or whatever your model uses for its positive prompt.
The clever part is the rule dropdown. The pack ships a bunch of preset rules, and which one you pick genuinely matters - because prompting is model-family-specific. There's 扩写-通用 (general prose), 扩写-Tags风格 which outputs Danbooru tags for the SD1.5/SDXL anime lineage, Qwen-Image-Edit指令优化 for edit-instruction models, Kontext指令优化并翻译 for FLUX Kontext workflows, and a Wan视频提示词 rule tuned for Wan 2.1/2.2 video prompts. If you dump an expanded natural-language paragraph into a model that was trained on tags, you're leaving quality on the table - and the reverse is equally true. The preset list is config-driven, so you can add your own in the pack's settings too.
The inputs that matter
You only really touch a handful of these:
user_prompt- the lazy prompt you actually wrote. This is the one you type in.rule- pick the paradigm that matches your target model (tags vs. prose vs. edit instruction).custom_rule/custom_rule_content- flip the switch and paste your own system prompt if none of the presets fit. It replaces the preset rule entirely.source_text(optional input port) - wire a prompt from another node in here. If bothsource_textanduser_promptare filled, they get merged, input port first.llm_service-服务名/模型名format, e.g.智谱/glm-4-flash-250414orOllama/qwen3:14b.
Output is one enhanced_text string. That's it.
The seed widget controls re-execution rather than output randomness in the usual sense: keep it fixed and identical inputs won't re-fire the API call; set it to randomize and the node re-runs every queue. Handy when you're iterating.
Install
ComfyUI Manager, search Prompt Assistant (or 提示词小助手), install, restart. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/yawiii/ComfyUI-Prompt-Assistant.git
Then restart ComfyUI. You'll need a recent ComfyUI - the pack targets the newer V3 node API. Before first use, open the pack's configuration UI and drop in an API key (the Zhipu free tier is enough to start), or configure Ollama if you want everything local.
Where people get burned
The Zhipu free models do content review, and the README is explicit: if your prompt trips it, you get an empty result back - that's the API refusing, not the node breaking. If you see "API returned empty result" in the console, that's usually it. Also note the LLM output is only as good as the rule: expand a tag-style prompt with the 扩写-通用 rule and you'll get prose that a tag-trained anime model won't parse well. Pick the rule for the model you're feeding, or the enhancement is just polish on a mismatch.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| rule | COMBO | 扩写-通用 | Choose a preset rule for prompt enhancement |
| custom_rule | BOOLEAN | false | Enable to use custom rule content below instead of preset |
| custom_rule_content | STRING | Enter your custom rule content here | |
| user_prompt | STRING | The original prompt to enhance | |
| llm_service | COMBO | 智谱/glm-4-flash-250414 | Select LLM service and model |
| ollama_auto_unload | BOOLEAN | true | Auto unload Ollama model after generation |
| seed | INT | 00–18446744073709550000 | — |
| source_textopt | STRING | Optional input text |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| enhanced_text | STRING | — |