Nodes/ComfyUI_DW_Chat/Ollama Prompt Extractor
ComfyUI Node

Ollama Prompt Extractor

A free SD prompt generator that runs entirely on your own machine

By yiwangsimple·Created 2 years ago·Updated about a year ago· 89
Ollama Prompt Extractor
    • positive_prompt
    • negative_prompt
    model
    extra_modelnone
    theme
    max_tokens1000
    temperature0.7
    prompt_type
    seed-1

    The Ollama Prompt Extractor is the free, no-API-key member of the ComfyUI_DW_Chat pack (the repo is yiwangsimple/ComfyUI_GroqChat). Where the pack's other prompt writers call Groq, Kimi, or DeepSeek over the cloud, this one talks to your local Ollama install. You type a theme - "cyberpunk street market at night" - and it returns a ready-to-use positive and negative prompt pair aimed at SDXL, Kolors, or Flux. Nothing leaves your machine, and there's no key to paste anywhere.

    This is "LLM-assisted prompting" as a node, the thing the KB's prompt-engineering essay tracks going from a browser tab to in-graph tooling. If you're already running Ollama for chat, this node gives you the same LLM free of charge, forever.

    How it works

    At ComfyUI startup the node asks Ollama's /api/tags endpoint on localhost:11434 and builds the model dropdown from whatever you've pulled. On each run it POSTs to /api/generate with a long task-specific system prompt (written in Chinese, per the author) that tells the model exactly how to write.

    That's where prompt_type matters:

    • sdxl - expects Prompt: / Negative Prompt: in the reply and splits the two into separate outputs. This is the only mode where the negative is actually written by the model.
    • kolors - a Chinese natural-language prompt, plus a hardcoded negative ("低质量,坏手,水印").
    • flux - a long English description (the system prompt demands 180+ words), plus a hardcoded negative.

    So for Flux and Kolors the negative_prompt output is boilerplate, not model-generated. Don't expect reasoning there.

    Inputs and outputs

    The inputs you'll actually touch: theme (what the image should be about), prompt_type, model, and seed (-1 randomizes). max_tokens (default 1000) and temperature (default 0.7) are fine as-is. extra_model is the escape hatch: type a model name here and it overrides the dropdown - useful when the list is stale.

    The outputs are plain strings: positive_prompt and negative_prompt, wired straight into your checkpoint's positive/negative (or just positive, for Flux).

    Installing it

    You can't install this node alone - it ships in the whole pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yiwangsimple/ComfyUI_GroqChat
    

    Then restart ComfyUI. ComfyUI Manager also finds it if you search for "ComfyUI_DW_Chat". Be aware the pack is a grab-bag: its requirements.txt drags in transformers, torch, groq, dashscope, qwen-vl-utils and friends even if you only ever use this one node. Most of those are already present in a GPU ComfyUI install, but expect a chunky first install.

    Common issues

    The big one: the model dropdown shows "No models found". That's not a bug in the node - it means Ollama wasn't running (or had no models) when ComfyUI started. The list is captured once at import time, so:

    1. Make sure ollama serve is running and pull a model: ollama pull llama3.1.
    2. Restart ComfyUI so the dropdown refreshes.
    3. Pulled a model after launch and don't want to restart? Type its exact name in extra_model.

    Beyond that, quality tracks your model - a tiny 1B model gives you mush, while a 70B-class one actually follows the elaborate system prompt. And if you need model-written negatives, use sdxl mode or a different node; this one hand-rolls them for the other two types.

    Category🌙DW/prompt_utils

    Inputs (7)

    NameTypeDefaultDescription
    modelCOMBO1 options: No models found
    extra_modelSTRINGnone
    themeSTRING
    max_tokensINT10001–32768
    temperatureFLOAT0.70–2
    prompt_typeCOMBO3 options: sdxl, kolors, flux
    seedINT-1-1–18446744073709550000

    Outputs (2)

    NameTypeDescription
    positive_promptSTRING
    negative_promptSTRING