Claude Prompt Expander
Use Claude to expand a short description into a detailed image prompt.
Nodes (1)
Claude Prompt Expander for ComfyUI
A single ComfyUI node that uses Claude API to expand a short description into a detailed image prompt.
Written for FLUX.2, but the system prompt is editable so it works with any model.
Costs a fraction of a cent per expansion.
Why
The bundled Anthropic node bills ComfyUI credits. Most third-party alternatives are unmaintained and point at deprecated API endpoints. This one is ~70 lines, has no dependencies beyond the standard library, and keeps your API key out of the workflow. ComfyUI serialises widget values into the workflow JSON, and embeds that JSON in the metadata of every PNG it saves. An API key typed into a node widget travels with every image you share.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/IdarV/comfyui-claude-prompt-expander
Create key.txt in the node folder (next to __init__.py) containing your Anthropic API key:
sk-ant-...
Restart ComfyUI
Usage
Wire the text output into whatever consumes your prompt.
| Input | Notes |
|---|---|
| prompt | Your short description, e.g. "viking portrait" |
| system | Instructions for the expansion. Edit to taste. |
| model | Defaults to claude-sonnet-4-6 |
| max_tokens | Response cap |
| seed | Change it to force a fresh call — ComfyUI caches identical inputs |
The expanded prompt is printed to the console so you can see what was actually sent.