PromptExpander
Turns \"a beautiful girl\" into a paragraph of prompt — whether you want that or not
- expanded_prompt
PromptExpander is a one-trick node, but the trick has a history: it takes your short prompt and writes a long, English-prose version of it using the roborovski/superprompt-v1 model, a small T5 that was fine-tuned on prompt-expansion data. It's the same idea lllyasviel baked into Fooocus as a "style" you couldn't even see, except here the expander is the whole product and you can argue with its output before it ever reaches a sampler. If you're tired of staring at a two-word prompt and wondering why the image is a two-word image, this is the node that fills in the rest of the sentence for you.
One honest caveat before you wire it in: this is a text-to-text model from the SD 1.5 era, and the prose it writes suits models whose text encoder reads sentences - the T5-conditioned Flux family, Chroma, that lineage. On a booru-tag SDXL checkpoint it's often a miss; the expanded paragraph gets chopped at the 77-token chunk boundary and the vocabulary is the wrong register entirely. The KB's own finding is that on SDXL the tag list transfers and the natural-language paragraph doesn't. Keep that in mind and this node is a tool, not a magic button.
How it works. The node loads SuperPrompt-v1 (77M params, T5-small class - genuinely small and fast), prepends a system line (Expand the following prompt to add more detail:), then runs conditional generation with sampling, up to 512 new tokens, a repetition penalty of 1.2, and a regex pass that trims a trailing incomplete sentence. A seed controls the sampler, so you get reproducible expansions with the same seed and re-roll them with a different one. It's a plain language model doing what language models do; there's no API call, no key, nothing to configure on a server.
The inputs that matter. Only three, and they're all on the node:
prompt- the string to expand. It's required, so there's no bypassing the expansion if the node is in your graph.seed_mode-fixed,random, orincrement. Fixed reproduces the same expansion for a given seed; increment walks the seed forward by one each run, handy for batch-variation workflows.seed- the base seed, in the usual huge ComfyUI range.
The output is a single expanded_prompt STRING, and you wire it straight into a CLIP Text Encode node in place of your own prompt. That's the whole integration.
The gotcha the README hides. The README advertises max_new_tokens, repetition_penalty, and remove_incomplete_sentences as node parameters. The shipped node exposes none of them - check the INPUT_TYPES and you'll see only prompt, seed_mode, and seed. The others still exist as hardcoded defaults in the code (512 tokens, penalty 1.2, sentence-trimming always on), they're just not reachable from the UI. The README describes the upstream SuperPrompter node, not this one. So if you expected to tune output length, you can't here.
Installing it. Through ComfyUI Manager, search "ComfyUI-Prompt-Expander" and hit Install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/jinanlongen/ComfyUI-Prompt-Expander
pip install -r requirements.txt # transformers>=4.30.0, torch>=2.0.0
Restart ComfyUI and you'll find "PromptExpander" under the Prompt category. On first run it downloads the model from HuggingFace automatically - a few hundred MB - and caches it in ~/.models/, not in ComfyUI's own models folder, which trips people up when they go looking for it later.
What actually bites people. The first run can look frozen while that download happens; check ~/.models/roborovski/superprompt-v1 to see if it's mid-fetch. On CPU it works but crawls, since the model is loaded at fp16 unconditionally and a 512-token expansion on CPU is not a quick cup of tea. And one more thing: this pack is a thin re-post of the 2024 SuperPrompter idea (the README credits the unofficial port it's based on), and community discussion of it died out around 2025. It's fine for what it does - a small, offline prompt-expansion utility - just don't expect updates or a support community behind it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Enter prompt here | — |
| seed_mode | COMBO | fixed | 3 options: fixed, random, increment |
| seed | INT | 10–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| expanded_prompt | STRING | — |