Nodes/comfyui-byokey/BYOKey Claude (Anthropic)
ComfyUI Node

BYOKey Claude (Anthropic)

Claude with your own key, plus vision

By MeteorAndy·Created 4 months ago·Updated 3 months ago· 0
BYOKey Claude (Anthropic)
  • images
  • output
api_key
base_urlhttps://api.anthropic.com
prompt
modelSonnet 4.6
seed0
system_prompt
max_tokens32768
temperature1.00
reasoning_effortoff

If you want Anthropic's Claude inside a ComfyUI workflow - prompt rewriting, image description, dialogue for a video - this is the BYOKey node that does it. BYOKey_Claude is the drop-in equivalent of the official Anthropic API node, but it talks directly to api.anthropic.com with your own key (sent as the x-api-key header) instead of routing through Comfy's proxy and its credit system. Same shape as the rest of the pack: bring your own key, keep your workflows, skip the middleman.

The headline feature here is real multimodal input. Hook an image into images and Claude actually sees it - the node handles up to 20 images per call. That's what makes this more than a glorified text box: a captioning or image-to-prompt loop where Claude reads your current frame and writes the next prompt is a very common ComfyUI pattern, and this node slots straight into it.

How it works

It sends your prompt plus an optional system_prompt (the foundational instructions that set the model's behavior) to Anthropic's Messages API, then returns the reply as a STRING output. Images are inlined as base64 data URIs, same as every vision-capable node in this pack. Nothing runs locally - the API call is the whole job.

The inputs that matter

  • model - a dropdown defaulting to Sonnet 4.6, with Opus 4.7, Opus 4.6, Sonnet 4.5, and Haiku 4.5 on the list. Pick the cheapest model that does the job; for short structured rewrites Haiku is usually plenty and much cheaper.
  • system_prompt - where you tell Claude what its job is. For prompt enhancement this is where you'd say "rewrite this as a detailed image prompt, no preamble."
  • reasoning_effort - off (default), low, medium, high. This is Anthropic's extended-thinking dial, and it's the setting people usually forget exists. Note the gotchas: it's ignored for models that don't support thinking (Haiku 4.5), and temperature is ignored whenever reasoning is turned on - so don't chase randomness with temperature on a thinking model, it won't do anything.
  • max_tokens (default 32768) - the ceiling for the response, including reasoning tokens when thinking is enabled. If you're getting cut-off replies with thinking on, raise this.
  • temperature - 0 to 1, default 1. Only meaningful for non-thinking models.

The seed widget is worth a mention because it lies a little: per the tooltip it only controls whether the node re-runs - results are non-deterministic regardless. Don't expect reproducible generations from Claude.

Output is a single output STRING, wired into whatever text consumer your workflow uses.

Installing it

It's part of the comfyui-byokey pack, which has no extra dependencies beyond what ComfyUI already ships. Install via ComfyUI Manager (search "byokey") or:

cd ComfyUI/custom_nodes
git clone https://github.com/MeteorAndy/comfyui-byokey.git

Restart, and you'll find it under api/byokey/text. No model files, no GPU required.

Gotchas

Anthropic's native API is not OpenAI-compatible, which is exactly why this node exists separately from BYOKey_LLM - don't try to point the generic LLM node at Anthropic's API. The base_url defaults to https://api.anthropic.com; override it only if you're going through a relay/proxy. The usual BYOKey cautions apply: your API key is stored in the widget and saved into the workflow JSON, so scrub it before sharing workflows, and - because this is a node whose whole job is phoning home with a credential - it's worth the two minutes to read the source if you're the cautious type. It's open source and short. Pick your model, paste your key, and Claude becomes just another node in the graph.

Categoryapi/byokey/text

Inputs (10)

NameTypeDefaultDescription
api_keySTRINGAnthropic API key (sent as the x-api-key header).
base_urlSTRINGhttps://api.anthropic.comAPI base URL. Default targets Anthropic directly; override for a compatible relay/proxy.
promptSTRINGText input to the model.
modelCOMBOSonnet 4.6The Claude model used to generate the response.
seedINT00–2147483647Seed controls whether the node should re-run; results are non-deterministic regardless of seed.
imagesoptIMAGEOptional image(s) for multimodal context. Up to 20 images.
system_promptoptSTRINGFoundational instructions that dictate the model's behavior.
max_tokensoptINT327684096–64000Maximum number of tokens to generate (includes reasoning tokens when enabled).
temperatureoptFLOAT1.000–1Controls randomness. 0.0 is deterministic, 1.0 is most random. Ignored for Opus 4.7 and any model when reasoning_effort is set.
reasoning_effortoptCOMBOoffExtended thinking effort. 'off' disables reasoning. Ignored for models that do not support thinking (e.g. Haiku 4.5).

Outputs (1)

NameTypeDescription
outputSTRING