Nodes/ComfyUI Neural Nodes/Ollama Generator xO🤖
ComfyUI Node

Ollama Generator xO🤖

Send a prompt to a local Ollama model and get text back

By xobiomesh·Created 2 years ago·Updated 2 years ago· 1
Ollama Generator xO🤖
    • response
    â—„textWhat is Art?â–ş
    â—„systemâ–ş
    â—„model_namedolphin-llama3â–ş
    â—„host_urlhttp://localhost:11434â–ş
    â—„keep_alivefalseâ–ş

    This is the node the whole pack's README is actually about - everything else in it is either support tooling or a later addition. Point it at a running local Ollama install, give it something to say, and it hands you back whatever the model writes. In practice, that's almost always used for one thing: getting an LLM to write or expand your image prompt before the image model ever sees it.

    That's not a fringe use case anymore. It used to be something you'd do in a separate browser tab and paste the result over - now it's a node, and the pattern has grown roughly twentyfold in community discussion over the last couple of years. It makes sense once you think about the architecture rather than the workflow: most current image and video models read instructions through an LLM-based text encoder, so having a separate LLM write that instruction for you is two systems that already speak the same language talking to each other. Ollama is the standard way to do that step locally and free, without an API key or a per-call bill.

    How it works

    It's a thin client to Ollama's local HTTP API - sends your prompt (and optional system prompt) to whichever model you point it at, waits for the full response, and passes the raw text straight through. No streaming in the UI, no post-processing; you get exactly what the model returned.

    The inputs and outputs that matter

    • text - your actual prompt, multiline, defaulting to the placeholder "What is Art?" (swap it for whatever you want the model to write).
    • system - the persona/instruction layer, and the field the README's "multi-agent conversations with unique roles" framing is really built on. Leave it blank for a plain assistant, or set something like "You are a terse prompt writer for photorealistic portraits, output one paragraph, no preamble" to bias every response toward a specific job.
    • model_name - a plain STRING, default dolphin-llama3. Type a model name directly, or wire in OllamaModelSelect's output so you're always picking from what's actually installed.
    • host_url - default http://localhost:11434. Only needs changing if Ollama is running somewhere other than the same machine - a Docker container, WSL, a different box on your network.
    • keep_alive (true/false, default false) - whether Ollama keeps the model loaded after this call. See troubleshooting below; this one matters more than it looks like it should.
    • response - the single STRING output. Wire it into ShowText_xO to actually read it, or into any node whose text field you've converted to accept a wired input, like a CLIP Text Encode prompt.

    How to install it

    Standard pack install - ComfyUI Manager, search ComfyUI Neural Nodes, or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xobiomesh/ComfyUI_xObiomesh
    

    then restart. The pack itself needs nothing heavy, but this node is useless without a separately-installed, separately-running Ollama server (ollama.com) with at least one model pulled - ollama pull dolphin-llama3 or your model of choice. Ollama handles its own model storage and downloads entirely outside of ComfyUI; this node never downloads anything itself.

    Common issues & troubleshooting

    Connection refused / node errors immediately. Ollama isn't running, or host_url doesn't match where it's actually listening. Sanity-check with curl http://localhost:11434 (or your real host_url) in a terminal before assuming the node is broken.

    Model not found. You typed a model_name that isn't pulled locally. ollama list to check what you actually have, ollama pull <name> to fix it - or sidestep the whole class of error by wiring in OllamaModelSelect instead of typing the name yourself.

    First call is slow, later ones are fast. Normal Ollama behavior - the first request loads the model into memory, later ones reuse it. People running this pattern report Ollama doesn't meaningfully fight your image model for VRAM as long as it's actually unloading between uses, which is exactly what keep_alive: false does - it releases the model after each response instead of pinning it. Flip it to true only if you're calling this node repeatedly in one session and don't mind it sitting in memory alongside your image model.

    Response is empty, off-topic, or ignores your system prompt. Check the model you picked is actually instruction/chat-tuned - a bare base model handles "What is Art?" very differently than something like dolphin-llama3. Also check system and text aren't fighting each other; an overly rigid system prompt can suppress the specifics you put in text.

    Categoryđź’¦xObiomesh/Ollama

    Inputs (5)

    NameTypeDefaultDescription
    textSTRINGWhat is Art?Input text to send to Ollama
    systemSTRINGSystem prompt to set the behavior and context for the model
    model_nameSTRINGdolphin-llama3Name of the Ollama model to use
    host_urlSTRINGhttp://localhost:11434Ollama server URL (e.g., http://localhost:11434)
    keep_aliveCOMBOfalseKeep model loaded in memory (true) or unload after each generation (false)

    Outputs (1)

    NameTypeDescription
    responseSTRING—