ComfyUI Node

LLM Call

The generic LLM caller that works with Ollama out of the box — no key, no account

By antoinebou12·Created 6 months ago·Updated 17 days ago· 3
LLM Call
    • text
    prompt
    negative_prompt
    api_key
    providerollama
    modelllama3.2
    ollama_base_url

    LLM Call is the engine of this pack's "type a sentence, get a diagram" workflow, but don't let the UML branding fool you - it's a straight-up text-in, text-out LLM caller. It takes a prompt, phones a chat model, and hands you the reply as a string. The pack ships it because the reply is meant to become diagram code, yet nothing here is diagram-specific: the text output will plug into anything that accepts a STRING in your graph.

    The best part is the default. Provider is ollama, model is llama3.2, and there's no API key anywhere in sight. You install this, point it at a local Ollama install, and you're calling a real LLM for free. That's the honest reason this node beats wiring up a generic text node: the local path just works.

    How it works

    Under the hood it's httpx calls to the provider's chat API - nothing exotic. Each provider gets its own endpoint (/api/chat for Ollama, /chat/completions for OpenAI, /v1/messages for Anthropic, generateContent for Gemini). The negative_prompt input isn't a second prompt: it's turned into a system instruction along the lines of "Do NOT do the following: ...". That sounds backwards until you remember why it exists - the pack's other nodes produce diagram code, and models love to wrap it in ``` fences and add a friendly preface. A negative prompt is your leash.

    A few genuinely useful details:

    • Ollama: no key. Base URL defaults to http://localhost:11434, override with the ollama_base_url widget or the OLLAMA_BASE_URL env var. The model dropdown is loaded live from your Ollama server, so if you ollama pull a new model, hit Refresh on the node.
    • OpenAI / Anthropic / Gemini: paste a key into api_key, or set OPENAI_API_KEY, ANTHROPIC_API_KEY, or GEMINI_API_KEY in the environment. Miss both and it raises an error that tells you exactly which env var it wants. It's a small thing, but way friendlier than a cryptic 401.
    • Negative prompt + prompt both go out on the same call, so you're not paying for two round trips.

    What you actually set

    Only a couple of inputs matter for a beginner: prompt (the thing you ask), provider, and model. api_key and ollama_base_url only matter for cloud providers or non-default Ollama setups. The output is text - connect it to UML Render's code_input and run, or use it for anything else that wants generated text.

    Installing it

    This is one of five nodes in the antoinebou12/ComfyUI-UML pack (MIT, published to the Comfy Registry). Install the pack, get all five:

    comfy node install comfyui-uml
    # or, manually:
    cd ComfyUI/custom_nodes && git clone https://github.com/antoinebou12/ComfyUI-UML
    pip install -r requirements.txt
    

    Restart ComfyUI after installing. Dependencies are light - just httpx and kroki for the diagram side.

    Where people get burned

    • Ollama isn't running → connection refused. Run ollama serve (or have the app open) before queuing.
    • Model not pulled → Ollama returns an error; ollama pull llama3.2 fixes it.
    • Cloud timeout - the HTTP timeout is 60 seconds. Big prompts on slow models can trip it, but for diagram generation you rarely hit that.
    • There's also a hidden test mode: with COMFY_UI_UML_MOCK_LLM=1 set, the node returns a canned Mermaid snippet instead of calling anything. Handy if you want to test a workflow without an LLM running.

    One honest caveat: this is a small, newer pack, not a household name like rgthree or Impact Pack. The author posts their own work on r/comfyui and publishes to the Registry, and the repo runs CI tests, but it's not battle-tested by thousands of users yet. Fine for a diagram side-quest in a workflow; don't build your whole pipeline around it.

    CategoryUML

    Inputs (6)

    NameTypeDefaultDescription
    promptoptSTRING
    negative_promptoptSTRING
    api_keyoptSTRING
    provideroptCOMBOollama4 options: ollama, openai, anthropic, gemini
    modeloptCOMBOllama3.218 options: llama3.2, llama3.1, mistral, codellama, qwen2.5-coder, phi3, +12
    ollama_base_urloptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING