ComfyUI Node

Qwen LLM Run

A local 3B model that writes your prompts for you

By billwuhao·Created 2 years ago·Updated about a year ago· 24
Qwen LLM Run
    • STRING
    modelQwen2.5-3B-Instruct-Flux
    systemAct like a prompt engineer for Stable Diffusion. You need to give me the most accturate prompt for my input. Don't introduce your message, give ONLY the prompt. Prompt must be around 150 words.
    textGive me a prompt for Stable Diffusion
    seed0
    max_new_tokens512
    temperature0.70
    top_k50
    top_p0.95
    keep_model_loadedfalse

    This node drops a small language model straight into your ComfyUI graph and puts it to work as a prompt engineer. You type a rough idea, it writes back a proper prompt. No API key, no OpenAI account, nothing leaving your machine - it's running a real 3B-parameter Qwen2.5-Instruct model locally.

    That's worth dwelling on for a second, because it used to not be normal. Writing prompts by hand-tuning tag lists, or pasting your idea into a chat window in another tab and copying the result back, was standard practice for years. It has quietly stopped being that - LLM-assisted prompt writing moved from "thing you do in a browser" to "thing a ComfyUI node does for you," and this is a straightforward, on-the-nose example of that shift. Dedicated local prompt-writer nodes are common enough now to draw real attention on release, and this is one of them, tucked inside a broader prompt-tooling pack.

    How it works

    You give it two pieces of text: a system instruction (the persona and task - the default has it "act like a prompt engineer for Stable Diffusion" and return only the prompt, around 150 words) and a text input (your actual idea, however rough). The model reads both, generates a response using the usual LLM sampling knobs, and hands back a single string.

    The inputs and outputs that matter

    • text - what you actually want. The default is a placeholder ("Give me a prompt for Stable Diffusion") - replace it with your real idea.
    • system - the instruction that shapes the output. It's plain editable text, not locked behavior. If you want tags instead of prose, or a shorter result, rewrite it.
    • model - Qwen2.5-3B-Instruct or Qwen2.5-3B-Instruct-Flux. The Flux-suffixed default is presumably the variant tuned toward this pack's use case; the plain Instruct model is there if you want a more generic assistant.
    • temperature, top_k, top_p - standard LLM sampling controls. Lower temperature and top_p make output more predictable and literal; push them up for more variety in phrasing.
    • max_new_tokens - hard cap on response length (128–2048).
    • keep_model_loaded - defaults to false, meaning the model unloads from VRAM after each run. Flip it on only if you have headroom to spare and want to avoid the reload cost on repeated runs.
    • seed - for reproducible generations.

    Output is a single STRING. Wire it straight into your text encoder, or use it as the second stage after OneButtonPromptFlux - that node hands you a rough starting prompt, this one turns it into something a Flux checkpoint will actually respond well to.

    How to install it

    ComfyUI Manager: search "ComfyUI_OneButtonPrompt", install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux
    

    Restart ComfyUI. The README doesn't list a formal dependency file - if the node fails to load, check the console for a missing Python package (this class of node typically needs transformers) and install it into ComfyUI's own environment.

    Common issues

    First run is slow, or seems stuck. It's downloading the model weights from Hugging Face the first time you use it - a few GB for a 3B model. Subsequent runs are fast.

    Running out of VRAM alongside your diffusion model. A 3B model needs a real chunk of GPU memory on top of whatever Flux itself is using. keep_model_loaded=false is the safe default for exactly this reason - it frees the memory back up after each call instead of holding it for the whole session.

    Output ignores your instructions. The system field is just text you can rewrite - if the default persona isn't giving you what you want (say, tags instead of a paragraph), change it directly rather than fighting the defaults through text alone.

    CategoryMW-OneButtonPrompt

    Inputs (9)

    NameTypeDefaultDescription
    modelCOMBOQwen2.5-3B-Instruct-Flux2 options: Qwen2.5-3B-Instruct, Qwen2.5-3B-Instruct-Flux
    systemSTRINGAct like a prompt engineer for Stable Diffusion. You need to give me the most accturate prompt for my input. Don't introduce your message, give ONLY the prompt. Prompt must be around 150 words.
    textSTRINGGive me a prompt for Stable Diffusion
    seedINT00–18446744073709550000
    max_new_tokensINT512128–2048
    temperatureFLOAT0.700–1
    top_kINT50
    top_pFLOAT0.950–1
    keep_model_loadedBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    STRINGSTRING