ComfyUI Node

SID LLM API

One ComfyUI node that talks to every cloud LLM (Ollama included)

By slahiri·Created 10 months ago·Updated 8 months ago· 59
SID LLM API
    • LLM_MODEL
    providerAnthropic
    api_key
    model[Anthropic] claude-sonnet-4-5-20250929
    custom_model
    api_url
    temperature0.3
    max_tokens_presetMedium (2048)
    custom_max_tokens4096
    enable_reasoningtrue

    This is the half of the AI Photography Toolkit that actually calls a cloud API - the name is not a lie, you do need a key for most providers here. It's the "bring your own brain" node for the pack's prompt generator: pick a provider, paste a key, pick a model, and out pops an LLM_MODEL connection that SID_ZImagePromptGenerator eats.

    Why bother? Because the pack's whole point is that Z-Image's Qwen3 LLM encoder wants natural-language prompts, and the best prompt writers happen to be other LLMs. Which one you use is supposed to be a swap, not a workflow rewrite. This node is that swap: Anthropic, OpenAI, Gemini, xAI Grok, Mistral, Groq, Together, OpenRouter, Fireworks - plus Ollama and LM Studio over their local HTTP APIs, which need no key at all. The author shipped the pack with Claude/GPT-4o as the headline quality option, but the free-tier providers (Groq, Together, OpenRouter) get you a vision-capable model without spending a cent.

    How it works. The node doesn't run inference - it assembles a config object (provider, model, API key, URL, max tokens, temperature, and a supports_reasoning flag) and hands it down the wire. That flag is the one that matters upstream: enable_reasoning on this node is what flips the prompt generator into its slower, multi-step agentic analysis. Reasoning off means single-shot. Worth knowing if your Claude calls feel expensive.

    Inputs. provider, api_key, model, custom_model, api_url, temperature, max_tokens_preset, custom_max_tokens, enable_reasoning. You really set three:

    • provider - which API to talk to. The model list and its prefix (e.g. [Anthropic]) follow your choice.
    • api_key - your key for that provider, or blank for the local ones.
    • enable_reasoning - on for the best multi-step analysis on models that support it (Claude 4.5, o1/o3, DeepSeek R1); off for speed.

    custom_model and api_url are the escape hatch: this is exactly what early users of the pack asked for - the release thread on r/comfyui wanted OpenAI-compatible endpoints and arbitrary model names, and these fields are the answer. Point api_url at anything OpenAI-compatible and type the model name in custom_model.

    Output. One LLM_MODEL output. Wire it into the llm_model input of SID_ZImagePromptGenerator. That's the entire contract.

    Install. ComfyUI Manager (search "AI Photography Toolkit"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/slahiri/ComfyUI-AI-Photography-Toolkit.git
    

    Restart ComfyUI; the Anthropic/OpenAI/google-genai SDKs install themselves on first launch.

    Gotchas. The API key is stored as a plain widget value in your workflow. Sharing a workflow JSON with a key in it is how people leak secrets - strip it, or use Ollama. And if prompts come out generic, the first thing to check is enable_reasoning: on a small fast model it's off by default for a reason.

    CategorySID Photography Toolkit/LLM Providers

    Inputs (9)

    NameTypeDefaultDescription
    providerCOMBOAnthropicSelect LLM provider
    api_keySTRINGAPI key for your provider (not needed for local providers)
    modelCOMBO[Anthropic] claude-sonnet-4-5-20250929Select model (provider prefix shows which API will be used)
    custom_modelSTRINGOverride model name (for custom/unlisted models)
    api_urlSTRINGCustom API URL (leave empty to use provider default)
    temperatureFLOAT0.30–2Creativity level (0=deterministic, 0.3=balanced, 1+=creative)
    max_tokens_presetCOMBOMedium (2048)Output length: Low=512, Medium=2048, High=8192, Very High=Model Max
    custom_max_tokensINT4096128–200000Custom max tokens (only used when preset is 'Custom')
    enable_reasoningBOOLEANtrueEnable extended thinking for supported models (Claude 4.5, o1, o3, DeepSeek R1, etc.)

    Outputs (1)

    NameTypeDescription
    LLM_MODELLLM_MODELLLM configuration to connect to SID_ZImagePromptGenerator