Nodes/ComfyUI-PromptGenerator/Prompt Generator (Qwen)
ComfyUI Node

Prompt Generator (Qwen)

An LLM writes your prompts locally — no API key, no cloud

By Limbicnation·Created 9 months ago·Updated 2 months ago· 10
Prompt Generator (Qwen)
    • prompt
    description
    stylecinematic
    modelqwen3:8b
    emphasis
    mood
    temperature0.7
    top_p0.9
    include_reasoningfalse
    timeout120

    Type a one-line idea, get a long detailed prompt back - that's the whole pitch, and it's the node the rest of this pack orbits. It runs Qwen3-8B through a local Ollama server, so there's no API key, no credit card, nothing leaves your machine. If you've ever stared at a blank prompt box for ten minutes, this is the thing that fixes it.

    A quick word on the landscape before you install: LLM prompt-generation nodes have been a small genre in ComfyUI for a while (Searge LLM, comfyui-ollama, and this pack), and they got more interesting as text encoders went from CLIP to full LLMs. The author, who posts on r/comfyui as Redlimbic, started from a standalone Gradio app called prompt-gen and wrapped it in ComfyUI nodes. The pack is Apache 2.0 and currently at v1.4.x - modest and honestly documented, which is more than you can say for a lot of custom nodes.

    How it works

    The node doesn't load a model into ComfyUI's own memory - Ollama does that. You type a description, pick a style preset, and the node renders a Jinja2 template (one per style, from config/templates.yaml in the pack folder) into a full instruction like "Write a detailed Stable Diffusion prompt for: … Focus particularly on: … Mood/Atmosphere: …". That goes to your local Ollama server, the response streams back token by token, and the node strips Qwen3's "Thinking… done thinking" block (plus any <think> XML) before handing you the finished prompt.

    Three things worth knowing about the mechanism:

    • The model dropdown is populated live from ollama list, cached for 60 seconds. Models with "lora", "prompt" or "style" in the name sort to the top. If Ollama isn't reachable it falls back to qwen3:8b, qwen3:4b, llama3.2:latest.
    • include_reasoning is off by default - Qwen3 is a thinking model, and that reasoning block is 90% the model talking to itself. Flip it on if you want to see its working, but you'll be pasting the output into your text encoder, not the thought process.
    • VRAM hygiene is baked in. After every call the model is evicted from Ollama's memory (keep_alive="0s") and PyTorch's CUDA cache is flushed in the background. That's a real fix, not cosmetics: the pack's own dev notes document "VRAM grow failed" OOM errors when Ollama kept 4-7 GB resident for the default five minutes and a diffusion text encoder then failed to load.

    Inputs and outputs

    Only a few of these matter on day one:

    • description (required) - your idea. This is the whole job; the more specific, the better the output.
    • style - nine presets: cinematic, video_wan, still_image, anime, photorealistic, fantasy, abstract, cyberpunk, sci-fi. (The README says seven - it's stale; the dropdown has nine.)
    • temperature (default 0.7) - creativity. Lower for more literal, higher for more wild.
    • timeout (default 120s) - raise this if the first run stalls; the tooltip is right that cold model starts are slow.
    • emphasis and mood are optional free-text that get woven into the template. include_reasoning and top_p you can leave alone.

    The single output is prompt (a STRING) - wire it into your CLIP Text Encode (Positive) node, or a Show Text / save node to inspect it first. One call, one prompt.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Limbicnation/ComfyUI-PromptGenerator.git
    cd ComfyUI-PromptGenerator
    pip install -r requirements.txt
    

    Or search "Prompt Generator" in ComfyUI Manager. Either way you need two prerequisites that are not part of the pip install:

    # 1. Ollama installed and running (https://ollama.ai)
    ollama serve
    # 2. The model
    ollama pull qwen3:8b
    

    Then restart ComfyUI and find it under Right-click → Add Node → text/generationPrompt Generator (Qwen).

    Troubleshooting

    • "Ollama not found" - Ollama isn't installed or isn't in your PATH. Install it, start the server, and make sure ollama runs from a terminal.
    • "Model not found" - you haven't pulled it: ollama pull qwen3:8b.
    • Temperature/top-p seem to do nothing - that's the subprocess fallback silently taking over because the ollama Python package isn't installed. pip install ollama, restart, and the controls work again. This is the most common complaint and it's almost always this.
    • First call times out - normal. The model is loading into memory cold; give it a higher timeout (up to 600s) and it'll be fast on the second run.

    One expectation to set: this is an LLM writing prose prompts, which is great for Flux/Z-Image-style models that run your prompt through an LLM encoder, and good for SDXL natural-language prompts. If you're on a tag-driven anime model like Illustrious or Pony, it can still help - just know those models want booru tags, and a paragraph isn't one. Use the output as a strong draft either way.

    Categorytext/generation

    Inputs (9)

    NameTypeDefaultDescription
    descriptionSTRING
    styleCOMBOcinematic9 options: cinematic, video_wan, still_image, anime, photorealistic, fantasy, +3
    modelCOMBOqwen3:8bSelect Ollama model. LoRA-enhanced models appear first.
    emphasisoptSTRING
    moodoptSTRING
    temperatureoptFLOAT0.70.1–1
    top_poptFLOAT0.90.1–1
    include_reasoningoptBOOLEANfalse
    timeoutoptINT12030–600Maximum generation time in seconds. Increase for cold model starts.

    Outputs (1)

    NameTypeDescription
    promptSTRING