Advanced Prompt Enhancerđ§¸
Run any LLM, local or cloud, inside ComfyUI
- Add_Parameter
- Custom_ApiKey
- image
- LLMprompt
- Context
- Help
- Troubleshooting
This is the Swiss-army knife of the Plush suite, and honestly the most genuinely useful node in it. Advanced Prompt Enhancer (APE) is a general LLM node: you give it an instruction and a prompt, it sends that to whatever language model you point it at, and it hands you back the text. The trick is the range of what it can talk to. ChatGPT, Anthropic, Groq, Gemini, or a model running locally on your own box through LM Studio or Ollama, or anything remote through OpenRouter. Same node, one dropdown.
If you've ever wanted to run a local Llama to write your prompts so nothing leaves your machine and nothing costs money, this is the node that does it. That's a big deal for anyone who cares about privacy or just doesn't want an OpenAI bill.
How it works
APE is a thin, flexible bridge. The AI_service dropdown picks the connection type, and there are ten of them: the named cloud services (ChatGPT, Groq, Anthropic, Gemini), the local front-ends (LM_Studio (URL), Ollama (URL)), and the generic URL connectors (OpenAI API Connection (URL), Direct Web Connection (URL), Web Connection Simplified Data (URL), Oobabooga API (URL)) for anything else that speaks a roughly OpenAI-shaped API. The (URL) ones are what you use for OpenRouter and other remote services that aren't preconfigured; you paste the endpoint into LLM_URL and pick your model.
Because it's just an LLM in a box, APE isn't only a prompt writer. People use it to caption images, rewrite text, evaluate an image against a prompt, or chain several APE nodes into a little agent loop where each one refines the last. The author himself posts example "agentic chain" workflows built from APE plus Tagger.
The inputs that matter
- AI_service: pick your connection. This is the master switch. Everything else depends on it.
- The model fields (
ChatGPT_model,Groq_model,Ollama_model,Optional_model, etc.): these populate based on your service and key. For Ollama you have to have loaded the model in Ollama before starting ComfyUI for it to show up. For URL services, model names come from the pack'sopt_models.txtfile (or the Load Remote Models node). - Instruction, Prompt, Examples_or_Context (all optional, multiline): the instruction is the system role ("you are a prompt writer, output tags only"), the prompt is your actual input, and examples let you do few-shot prompting.
- creative_latitude and tokens: temperature and output cap. Tokens goes up to 20,000 here, way more than Style Prompt, because you might be generating long text, not just a prompt.
- image (optional): feed a vision-capable model an image to caption or interpret.
There are three input slots meant for other Plush nodes: Custom_ApiKey (from the Custom API Key node), Add_Parameter (from Add Parameters, for injecting things like top_p that aren't in the UI), and the AI Chooser isn't needed here since APE picks its own service.
Outputs: LLMprompt is your generated text. Context carries the conversation forward so you can chain nodes and keep memory between them. Help and Troubleshooting are your debugging lifeline.
A tip on the output
Remember what the downstream model wants. If APE is writing prompts for a modern LLM-encoded model (Flux and friends), attention weights like (word:1.3) get silently discarded and BREAK means nothing, so tell your instruction to write plain descriptive text. For SDXL, ask for comma tags. The node will happily produce whatever you instruct, so the instruction is where the quality lives.
Installing it
Manager route: install Plush-for-ComfyUI (search "Plush"), restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/glibsonoran/Plush-for-ComfyUI.git, then pip install -r requirements.txt inside the folder, restart.
Common issues
For cloud services you need the right environment variable set (GROQ_API_KEY, ANTHROPIC_API_KEY, OAI_KEY/OPENAI_API_KEY, GEMINI_API_KEY) and often a machine reboot before it's seen. Groq's key is free, so it's the cheapest way to try APE end to end. For local LLMs, the classic trap is that your LM Studio or Ollama server isn't actually running, or Ollama doesn't have the model loaded yet. For URL connections, the two web-connection types want different paths (a /v1 path vs a /v1/chat/completions path), and mixing them up is the usual cause of a connection error. When it fails, Number_of_Tries lets it retry, and the Troubleshooting output tells you exactly what went wrong. Wire it to a text display and read it.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| AI_service | COMBO | Groq | Choose connection type/service, connections ending with '(URL)' require a URL to be entered below |
| ChatGPT_model | COMBO | 1 options: none | |
| Groq_model | COMBO | 1 options: none | |
| Google_Gemini_model | COMBO | 1 options: none | |
| Anthropic_model | COMBO | 1 options: none | |
| Ollama_model | COMBO | 1 options: none | |
| Ollama_model_unload | COMBO | No Setting | Choose how long this model will stay loaded after completion |
| Optional_model | COMBO | Enter these in the text file: 'opt_models.txt' in the Plush directory | |
| creative_latitude | FLOAT | 0.70.1â1.901 | temperature |
| tokens | INT | 80020â20000 | â |
| seed | INT | 90â18446744073709550000 | â |
| examples_delimiter | COMBO | Two newlines | 3 options: Pipe |, Two newlines, Two colons :: |
| LLM_URL | STRING | Enter the url for your service here when using connections that end with: (URL) | |
| Number_of_Tries | COMBO | default | 6 options: 1, 2, 3, 4, 5, default |
| Instructionopt | STRING | â | |
| Examples_or_Contextopt | STRING | â | |
| Promptopt | STRING | â | |
| Add_Parameteropt | LIST | â | |
| Custom_ApiKeyopt | KEY | â | |
| imageopt | IMAGE | â |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| LLMprompt | STRING | â |
| Context | STRING | â |
| Help | STRING | â |
| Troubleshooting | STRING | â |