Nodes/oshtz Nodes/LLM All-In-One
ComfyUI Node

LLM All-In-One

ChatGPT, Claude, or OpenRouter — One Node, Zero Local VRAM

By oshtz·Created 2 years ago·Updated 2 months ago· 6
LLM All-In-One
  • image
  • response
api_type
modelgpt-4o
max_token1024
temperature0.00
prompt
seed0
openai_api_key
anthropic_api_key
openrouter_api_key
openrouter_referer
openrouter_app_title
model_override

LLM All-In-One (the class is LLMAIONode) puts a text LLM call inside your ComfyUI graph. Pick a provider, type a prompt, get a string back that you can route straight into a prompt encoder. The classic job is prompt enhancement - feed it "a rainy cyberpunk alley, neon reflections" and it returns a richer version that a modern LLM-encoded model actually rewards. But it's just text in, text out, so it'll also write negative prompts, brainstorm variations, or tag a caption for you.

The big deal here is that none of this touches your GPU. The node calls hosted APIs - OpenAI, Anthropic (Claude), or OpenRouter - over HTTP. In an era where the strongest local encoders want natural-language instructions rather than tag soup (that's a whole 2026 prompting shift), an on-graph LLM call is a genuinely useful piece of the pipeline. The tradeoff is real and obvious: every run is a paid API call and needs internet.

How it works

The node wraps three provider APIs behind one interface. You pick api_type (openai, claude, or openrouter), and the node builds the right request - OpenAI's chat completions, Claude's messages API, or OpenRouter's unified endpoint. For OpenRouter it's slicker: the model dropdown is populated live from OpenRouter's model list, fetched through a backend endpoint the pack registers and cached for an hour. The OpenAI and Claude dropdowns are static lists.

Keys are handled the sane way: type them into the node's widget, or leave blank and it falls back to environment variables - OPENAI_API_KEY, ANTHROPIC_API_KEY (or CLAUDE_API_KEY), OPENROUTER_API_KEY. There's also model_override: a free-text field that beats the dropdown entirely, which you'll want because the static lists age (they still show gpt-3.5-turbo and claude-2.1).

The inputs and outputs that matter

Required, besides the provider and model: prompt (multiline), max_token (default 1024), temperature (default 0), and seed. One optional input is the interesting one: image (IMAGE). Feed it in and the node base64-encodes the tensor and sends it along - vision-capable models (like gpt-4o) will then answer questions about your actual generated image, which makes "what's in this image, and how do I prompt it better" a one-node loop.

The output is a single response STRING. Wire it into a text encode node or a prompt-enhancer chain and you're done.

Two small gotchas: the seed only applies to OpenAI and OpenRouter calls - Claude's API doesn't take one, so the node just doesn't send it there. And temperature defaults to 0, which is great for stable, literal rewrites but can make it boring; nudge it up if you want variety.

Installing it

Same install as the rest of the oshtz Nodes pack. ComfyUI Manager: search "oshtz". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/oshtz/ComfyUI-oshtz-nodes.git
cd ComfyUI-oshtz-nodes
pip install -r requirements.txt

Restart ComfyUI. Dependencies are requests, pydantic, Pillow, and numpy - no local models at all, which is the entire point. Just make sure your API key is set before your first run, or the node throws a clear "API key is required" error.

The honest take

If you want LLM smarts without the VRAM and without maintaining a local model, this is a clean single node. The per-call cost is the thing to watch - a prompt-enhancement loop that runs on every batch step can quietly eat credits, so put it where it runs once per image, not per step. And if you'd rather keep everything local, a GGUF-backed local LLM pack is the alternative; this node is explicitly the "just use the API" route, and it does that route well.

Categoryoshtz Nodes

Inputs (13)

NameTypeDefaultDescription
api_typeCOMBO3 options: openai, claude, openrouter
modelCOMBOgpt-4o17 options: gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-4, gpt-3.5-turbo, o1-preview, +11
max_tokenINT10241–32768
temperatureFLOAT0.000–2
promptSTRING
seedINT00–9007199254740991
openai_api_keyoptSTRINGOptional. Leave blank to use the matching environment variable.
anthropic_api_keyoptSTRINGOptional. Leave blank to use the matching environment variable.
openrouter_api_keyoptSTRINGOptional. Leave blank to use the matching environment variable.
openrouter_refereroptSTRING
openrouter_app_titleoptSTRING
model_overrideoptSTRINGOptional typed model id. Overrides the dropdown.
imageoptIMAGE

Outputs (1)

NameTypeDescription
responseSTRING