Nodes/ComfyUI Fooocus Nodes/Fooocus Expansion
ComfyUI Node

Fooocus Expansion

The prompt-expander that made short prompts work

By Seedsa·Created 3 years ago·Updated 2 years ago· 102
Fooocus Expansion
    • final_prompt
    • seed
    prompt
    seed0
    log_promptfalse

    The name is a lie, in the best way: this node doesn't call any API and needs no key. "Expansion" here is a small offline GPT-2 model that takes your one-line prompt and rewrites it into the long, descriptive paragraph SDXL secretly wants. It's the mechanism behind the "Fooocus V2" style, the thing that let beginners type "woman in a garden" and get an image that looked like it cost more effort than it did.

    How it works

    Type a prompt. The node runs it through a tiny GPT-2 language model tuned to expand art prompts - "a woman in a garden" becomes something like "a beautiful woman standing in a lush garden, soft morning light, shallow depth of field, film grain, professional photography..." - and hands you back the finished string plus a seed. That seed matters: the expansion is nondeterministic, so if you want the same expanded prompt every run, feed the same seed in. It's all local, it's free, and it's a GPT-2 from the frozen Fooocus era - nobody is maintaining it, but it doesn't need to be maintained.

    The inputs

    • prompt - your raw prompt. Multiline, so you can write a paragraph if you want. The only required field.
    • seed (optional) - lock the expansion. Default 0.
    • log_prompt - default off. Flip it on to print the expanded result to the console, which is genuinely handy the first time, so you can see what the model is doing to your words.

    Outputs: final_prompt (STRING) - feed this into the Loader's positive field or the Fooocus positive node - and seed (INT), so you can wire the same seed forward for reproducibility.

    Installing

    It's part of the Seedsa/Fooocus_Nodes pack: ComfyUI Manager → search "Fooocus Nodes", or clone the repo into custom_nodes. This is one of the nodes with a hidden model download - the GPT-2 weights pull on first use. Small (a few hundred MB), one-time, and unlike the pack's inpaint patch it's a plain text model, so no VRAM pressure.

    Where people get tripped up

    Two things. First, the expansion is only as good as your starting prompt - it embellishes, it doesn't rescue. Write the subject and the vibe you actually want, and let it do the dressing. Second, if you're chasing a specific look, expansion fights you: every run's rewrite is a different sentence, so your carefully-crafted prompt gets paraphrased into something else. That's the trade for the "wow, short prompt, great image" effect. Want consistency? Lock the seed, or skip this node entirely and feed your prompt straight through.

    CategoryFooocus

    Inputs (3)

    NameTypeDefaultDescription
    promptSTRING
    seedoptINT00–4294967295
    log_promptoptBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    final_promptSTRING
    seedINT