ComfyUI Node

Custom LLM API Node (Old)

Talk to any OpenAI-compatible LLM from inside your workflow

By AhBumm·Created 2 years ago·Updated 3 months ago· 11
Custom LLM API Node (Old)
    • LLM ANSWERS
    • seed
    • model
    • api_url
    • api_key
    seed0
    prompt
    modelgpt-4o
    api_urlhttps://api.hyprlab.io/v1
    api_keyYOUR_API_KEY_HERE
    system_prompt
    temperature1.00
    use_meta_promptfalse

    Want a language model to rewrite your prompt, brainstorm, clean up text, or write captions - and have the result land directly on a wire in your graph? That's what Custom LLM API Node does. It's a chat-completions caller that works with any endpoint speaking the OpenAI API dialect: OpenAI itself, OpenRouter, DeepSeek, a local LM Studio or Ollama server, whatever. The "(Old)" in its display name is the pack author's own marker - it's the legacy version, superseded by the streaming LLM node - but old here doesn't mean broken. It's honestly the easier one to start with, because it blocks until the answer is finished and hands you the whole text.

    How it works

    Under the hood it's a thin wrapper around the openai Python library pointed at whatever api_url you supply. It builds a classic two-message conversation - system prompt, then your prompt - and sends it with model, temperature, and seed. The interesting extra is use_meta_prompt: flip it on and the node discards your system prompt in favor of a hardcoded meta-prompt (a "you are a meticulous prompt engineer" style instruction) baked into the source. Handy when you want the model wearing its prompt-engineering hat, less handy when you have a specific system instruction.

    It's also wired for the real world: tenacity retries the request with exponential backoff up to three times on connection errors, rate limits, timeouts, and 5xx responses. Slow or flaky providers won't silently kill a run.

    The inputs that matter

    • api_url - defaults to https://api.hyprlab.io/v1, a third-party OpenAI-compatible aggregator the author uses. This is the first thing to change. Point it at the provider you actually have a key for.
    • api_key - defaults to the literal string YOUR_API_KEY_HERE. Yes, really. Paste yours.
    • model - defaults to gpt-4o, but any model your endpoint offers works (or a local one, if your URL is a local server).
    • prompt and system_prompt - your request and the model's instructions.
    • temperature (0–2) and seed - the usual knobs; seed is passed to the API for reproducibility-ish behavior, though don't expect byte-identical output across providers.

    Outputs: LLM ANSWERS (STRING) is the text you want. The node also passes back seed, model, api_url, and api_key as outputs - mostly so you can record what actually ran, which is a nice touch for keeping workflows honest.

    Installing it

    Part of AhBumm/ComfyUI_BillBum_Nodes. ComfyUI Manager → search "billbum", or manually:

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

    Restart ComfyUI. No models to download - the openai package is the only real dependency, and if you already have any other OpenAI-compatible node installed, it's likely already in your environment.

    Where people get burned

    • Key/URL mismatch. The default URL is HyprLab; paste an OpenAI key without changing the URL and you get auth errors. Always change both, and remember the README's rule of thumb: auth error → check key and base URL; model error → check the model actually exists on that provider.
    • System prompt vs. meta prompt. If your careful system prompt seems to be getting ignored, check use_meta_prompt - when it's on, your system prompt is replaced wholesale.
    • Output is raw text. If you're feeding it to a sampler, you'll need prompt-packing or a text-to-CLIP route; this node returns STRING, full stop.

    Reach for it when you want a dependable "ask a model, get an answer" block in your graph. The streaming sibling is prettier for chat; this one is simpler for pipelines.

    CategoryBillBum_API

    Inputs (8)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000
    promptSTRING
    modelSTRINGgpt-4o
    api_urlSTRINGhttps://api.hyprlab.io/v1
    api_keySTRINGYOUR_API_KEY_HERE
    system_promptSTRING
    temperatureFLOAT1.000–2
    use_meta_promptBOOLEANfalse

    Outputs (5)

    NameTypeDescription
    LLM ANSWERSSTRING
    seedINT
    modelSTRING
    api_urlSTRING
    api_keySTRING