Nodes/Sage Utils/LLM Prompt (Text)
ComfyUI Node

LLM Prompt (Text)

One text-generation node that talks to Ollama, LM Studio, OpenAI, or a local GGUF

By arcum42·Created 2 years ago·Updated 28 days ago· 33
LLM Prompt (Text)
    • response
    promptWrite a detailed and coherent description of an image based on the provided list of tags.
    provider
    seed0

    LLM-in-ComfyUI nodes usually have a problem: they're welded to one backend. Here's the one that runs Ollama, then this one for LM Studio, and that one is a port of some OpenAI wrapper. Sage Utils' LLM Prompt (Text) takes the opposite approach - it's one node with a provider dropdown, and it handles the local servers, the cloud API, and even a fully-offline mode where the "LLM" is a GGUF model loaded the way ComfyUI loads a CLIP.

    So if you've been putting off wiring an LLM into your workflow because you weren't sure which backend to commit to, this is the node that lets you not decide.

    How it works

    The provider dropdown is a dynamic combo. Pick one and the node grows the matching set of fields:

    • LM Studio - model dropdown populated from a running LM Studio server (load_for_seconds, optional system prompt).
    • Ollama - model list from a running Ollama (keep_alive, low-level options, system prompt).
    • OpenAI - model list, temperature, max tokens, system prompt. Works with any OpenAI-compatible endpoint that exposes its models, which means most local proxy servers too.
    • Native - the interesting one. No HTTP server at all. You plug a CLIP input into native_clip (a GGUF LLM loaded the way ComfyUI's core TextGenerate node does it) and set max_length, optional thinking, and sampling knobs (temperature, top_k, top_p, min_p, penalties). It's the same underlying local-generation path ComfyUI core added for running small LLMs entirely on your own machine.

    The node sends your prompt to whichever provider is selected, waits for the response, and returns it as a single STRING output called response. There's also a seed input (default 0) that providers use as a base seed where supported, so you can get repeatable generations.

    What you need to actually run it

    The node doesn't ship with any model. For the local servers: install LM Studio or Ollama, load a model, and start their local server (Ollama: ollama pull llama3.2, then the server runs by default). For OpenAI, you need an API key. For Native, you need a GGUF LLM file ComfyUI can load as a CLIP. If a provider isn't reachable, its dropdown shows a placeholder like "(Ollama REST not available)" - which is your clue to start the server, not a bug.

    Wiring it into a workflow

    The output is text, so it composes with everything else in this pack: send a raw prompt in, get an enhanced one out, feed it into a CLIP Text Encode. The pack's whole LLM story - the sidebar chat, the prompt builder - uses this same provider layer, so settings you get working here transfer to the UI features.

    Installing

    It's Sage Utils, so:

    cd ComfyUI/custom_nodes
    git clone https://github.com/arcum42/ComfyUI_SageUtils.git
    cd ComfyUI_SageUtils && pip install -r requirements.txt
    

    Restart ComfyUI, or search "Sage Utils" in ComfyUI Manager. No models to download for the node itself - the models live in your chosen backend.

    Where people trip

    The classic gotcha is expecting the model lists to be pre-populated before you've started the backend - they aren't, and the dropdowns read from the running server at graph load. Start LM Studio or Ollama before opening the workflow. Also worth knowing: provider behavior varies a bit, so the same seed may not reproduce across providers - the tooltip says as much. And if a provider call fails, the node returns an empty string rather than crashing the whole graph, which is convenient but means a silent empty response is your first failure signal. Check your server, then check the log.

    CategorySage Utils/LLM

    Inputs (3)

    NameTypeDefaultDescription
    promptSTRINGWrite a detailed and coherent description of an image based on the provided list of tags.The text prompt sent to the selected LLM provider.
    providerCOMBOPick the backend provider and its model/runtime settings.
    seedINT00–4294967295Base seed used by all providers (provider-specific behavior may vary).

    Outputs (1)

    NameTypeDescription
    responseSTRINGThe text response returned by the selected provider.