[Inference.Core] [Inference.Core] Prompt Expansion
The Fooocus trick of turning three words into a full prompt
- expanded_prompt
- seed
This is the odd one out in a pack full of ControlNet preprocessors - it has nothing to do with edges, depth, or pose. Prompt Expansion takes a short prompt and pads it out with extra descriptive detail using a small dedicated language model, the same idea Fooocus made famous as its "Fooocus V2" style: type three words, get back a prompt dense with the kind of descriptive detail that actually improves generation quality, without you having to hand-write it yourself. It's a genuinely useful trick for people who know roughly what they want but aren't great at prompt-crafting, or who just want more variety out of a short prompt without manually brainstorming adjectives every time.
How it works
The node runs a small offline language model - the same class of lightweight GPT-2-style expander behind Fooocus's built-in feature - that's been trained to riff on a short seed prompt and expand it into something more descriptive, adding the kind of texture, lighting, and composition language that tends to help diffusion output without you writing all of it by hand. It runs entirely locally and needs no external API.
The inputs and outputs that matter
text(multiline string, required) - your seed prompt, as short or long as you like.model_name(required) - which expansion model to use. Worth knowing up front: this dropdown ships empty by default (the node's own schema lists zero choices), meaning you need to actually have a compatible expansion model file in place before there's anything to select - see the install note below.seed(default 0) - controls the randomness of the expansion itself, separate from your image sampler's seed.log_prompt(defaultfalse) - when enabled, prints the expanded result to the console, handy for seeing exactly what got added without digging through node previews.
Two outputs: expanded_prompt (STRING) - wire this into your CLIP Text Encode instead of your original short prompt - and seed (INT), a passthrough of the seed used, useful for wiring into your sampler so the same input always expands the same way for reproducibility.
How to install it
ComfyUI Manager: search ComfyUI-Inference-Core-Nodes, install, restart. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes
then run install.py, or pip install -e .[cuda12] (or .[cuda] / .[rocm] / .[directml] / .[cpu]) to match your hardware. Restart ComfyUI. Unlike the pack's ControlNet preprocessors, this node does not appear to auto-download its model on first run - the README doesn't spell out an automatic fetch path for it, and the empty model_name dropdown in the node's own schema backs that up. If the dropdown is empty after installing and restarting, you'll need to source a compatible prompt-expansion checkpoint yourself and place it in the models folder this node expects before it has anything to select.
Common issues & troubleshooting
The single most likely first problem: opening this node and finding model_name has nothing in it. That's not a broken install - it's the expected state until a model file is actually present. Check the pack's GitHub for the exact expected folder and file naming before assuming something's wrong on your end.
Beyond that, treat the output the way you'd treat any auto-generated prompt addition: read it before trusting it. Small expansion models occasionally drift off-topic or add descriptive language that fights your original intent, especially on unusual or very short seed prompts - log_prompt is worth turning on the first few times you use this node so you can actually see what it's adding rather than finding out only from the image.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | 0 options: | |
| text | STRING | — | |
| seed | INT | 00–4294967295 | — |
| log_prompt | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| expanded_prompt | STRING | — |
| seed | INT | — |