Nodes/comfyui-outfit/🎯 Simple Ollama
ComfyUI Node

🎯 Simple Ollama

Local LLM Prompt Polish for ComfyUI, No API Key

By manifestationsΒ·Created about a year agoΒ·Updated 12 months agoΒ· 3
🎯 Simple Ollama
    • formatted_prompt
    β—„custom_dataβ–Ί
    β—„model_namedisabledβ–Ί
    β—„prompt_styleSDXLβ–Ί
    β—„ollama_urlhttp://127.0.0.1:11434/api/generateβ–Ί
    β—„seed0β–Ί

    Simple Ollama (class SimpleOllamaNode, in πŸ‘— Outfit/Support) is the pack's local-LLM prompt polisher: it takes whatever you type in custom_data, runs it past a model in your local Ollama install, and hands back a formatted_prompt better suited to your checkpoint. The name is a lie in the best way - it doesn't call any cloud API and needs no key. Everything stays on your machine at 127.0.0.1:11434.

    The prompt-engineering reason this exists: SDXL and Flux want different prose, and most people only know how to write one of them. This node carries a system prompt for each so a single vague idea ("man in a blue jacket at dusk") gets expanded in the right idiom - comma-separated SDXL tags, or a natural-language Flux description.

    How it works

    Three required inputs: custom_data (your raw idea), model_name (a dropdown that starts as disabled), and prompt_style (SDXL or Flux). Two optional ones: ollama_url (defaults to http://127.0.0.1:11434/api/generate) and seed (0–999999, passed to Ollama's options.seed when set, for reproducible generations).

    The dropdown is smart: the node queries Ollama's /api/tags and lists your installed models. Pick one and it builds a style-specific system prompt - for SDXL it demands comma-separated phrases under 200 tokens with no commentary; for Flux it demands concrete natural sentences under 100 tokens, subject first, with an example baked into the prompt. It POSTs to Ollama with streaming off, strips stray quotes from the reply, and returns it.

    The part worth knowing: disabled is a real, useful mode. With model_name: disabled it skips the LLM entirely and does local formatting - Flux gets comma-to-space conversion and wrapped in A detailed image of ..., SDXL just gets a trailing period. So the node degrades gracefully: no Ollama, no problem, you still get a passable prompt. Ollama-with-ComfyUI is a well-trodden path in the community (it comes up in r/comfyui regularly), and this is one of the lighter integrations - one endpoint, no key management.

    Install and setup

    Install the pack normally - ComfyUI Manager (search "ComfyUI Outfit Selection") or:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/manifestations/comfyui-outfit.git
    

    then pip install -r requirements.txt (it needs requests), and restart. For the LLM path you also need Ollama itself installed and running, plus at least one model pulled:

    ollama pull llama3.2
    

    You can use almost any text model - the system prompt does the heavy lifting, so a small model is fine for this job. No vision model needed here (that's the pack's separate vision node, which wants llava/moondream).

    Common issues

    • The model dropdown only shows "disabled". Ollama isn't running, or it isn't on the default URL. Start the server (ollama serve), pull a model, then reload ComfyUI - the model list is fetched at node-load time, so newly pulled models won't appear until the frontend reloads.
    • It "worked" but the output looks unenhanced. That's the silent fallback. If the request fails or the selected model isn't reachable, the node quietly formats locally instead of erroring - a small model can also return an empty string, triggering the same fallback. Check the console for [SimpleOllamaNode] Request failed before you blame the output.
    • Wrong idiom. If you're on Flux but left prompt_style at SDXL, you'll get a comma list the model treats like a grocery list. Match the style to your checkpoint; that's the whole point of the node.
    • Seed appears not to matter on some models. Ollama's seed support varies by model/backend; the node passes it when set, but don't treat exact reproducibility as guaranteed across models.

    It's a genuinely handy little node if you already run Ollama, and harmless if you don't - the disabled fallback means it never hard-requires anything. Just don't expect it to fix a bad model's prose, because a small local LLM will happily polish a bad idea into a longer bad idea.

    CategoryπŸ‘— Outfit/Support

    Inputs (5)

    NameTypeDefaultDescription
    custom_dataSTRINGβ€”
    model_nameCOMBOdisabled1 options: disabled
    prompt_styleCOMBOSDXL2 options: SDXL, Flux
    ollama_urloptSTRINGhttp://127.0.0.1:11434/api/generateβ€”
    seedoptINT00–999999β€”

    Outputs (1)

    NameTypeDescription
    formatted_promptSTRINGβ€”