Nodes/comfyui_LLM_party/☁️API LLM Loader
ComfyUI Node

☁️API LLM Loader

Where your API key actually goes

By heshengtao·Created 2 years ago·Updated 6 days ago· 2,321
☁️API LLM Loader
    • model
    model_namegpt-4o-mini
    base_url
    api_key
    is_ollamafalse

    This is the loader half of comfyui_LLM_party's API path - it doesn't generate any text itself, it just packages a model_name, base_url, and api_key into a model object that the pack's LLM node then actually uses to make requests. If you're following the pack's own "start with LLM API" quick-start workflow, this is the very first node in the chain, and it's worth understanding on its own because almost every API-backed workflow you build with this pack starts here.

    model_name is the only required field, defaulting to gpt-4o-mini - a sensible cheap default to test with before you commit to something pricier. The rest is optional because the pack expects most people to configure credentials once centrally rather than per-node: leave base_url and api_key blank and it'll fall back to whatever's set in the pack's config.ini. Fill them in directly on the node instead if you want a specific workflow to use different credentials than your default setup - say, testing a second provider without touching your main config. The README's own compatibility list is broad: straight OpenAI, Azure OpenAI, Grok, Qwen, GLM, DeepSeek, Kimi/Moonshot, Doubao, Spark, and Gemini (via its OpenAI-compatible endpoint) all work through this same node, because they all speak the same request format underneath. Point it at a relay service like one-api and you can reach almost anything through one loader.

    is_ollama deserves its own callout because it changes the required fields entirely. Flip it on and you're telling this node to talk to a local Ollama instance instead of a cloud API - at that point you don't fill in base_url or api_key at all, Ollama's own API convention handles that differently (the README's manual-config path spells it out as http://127.0.0.1:11434/v1/ for base_url and the literal string ollama for api_key, but the is_ollama toggle exists specifically so you don't have to remember that and type it yourself). The single output is model, which plugs straight into the pack's LLM node's model input - this loader and LLM are meant to be used as a pair, one always right after the other.

    Installing it means installing the pack: search "comfyui_LLM_party" in ComfyUI Manager, or git clone https://github.com/heshengtao/comfyui_LLM_party into custom_nodes and restart, then pip install -r requirements.txt from inside the pack folder using ComfyUI's own Python (portable builds need python_embeded\python.exe -m pip install -r requirements.txt specifically).

    The two things that actually go wrong here: base_url needs a trailing /v1/ for OpenAI-format endpoints - a URL that's missing it, or points at the base domain instead of the API path, throws connection errors that read scarier than the actual fix. And credential duplication is the classic silent failure - if you've set openai_api_key in config.ini and also left the node's api_key field blank expecting it to inherit, that generally works, but if you've filled in the node field with something wrong or stale while config.ini has the correct value, the node-level value wins and quietly overrides it. When a request fails with no obvious reason, check both places before assuming the API provider is at fault.

    Category大模型派对(llm_party)/模型加载器(model loader)

    Inputs (4)

    NameTypeDefaultDescription
    model_nameSTRINGgpt-4o-miniThe name of the model, such as gpt-4o-mini.
    base_urloptSTRINGThe base URL of the API, such as https://api.openai.com/v1.
    api_keyoptSTRINGThe API key for the API.
    is_ollamaoptBOOLEANfalseWhether to use ollama.

    Outputs (1)

    NameTypeDescription
    modelCUSTOMThe loaded model.