Nodes/SF ComfyUI Nodes/SF Claude Code
ComfyUI Node

SF Claude Code

Claude as a prompt node, billed to your subscription — no API key involved

By Stillfront·Created 3 months ago·Updated 3 days ago· 1
SF Claude Code
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • image_11
  • image_12
  • image_13
  • image_14
  • image_15
  • image_16
  • text
◄prompt►
◄system_prompt►
◄modeldefault►
◄timeout_seconds300►
◄seed0►

The interesting part isn't the prompt box

Most "LLM in ComfyUI" nodes are API wrappers: paste a key, pay per token, your images leave the machine. SF Claude Code does none of that. It shells out to the Claude Code CLI running on your own computer, so it runs on the Claude login you already have and bills against that subscription instead. The description even says the quiet part out loud - no API key needed - and it means it.

Why put Claude in a graph at all? Because an LLM rewrites. You have a rough idea, a caption, or an image you want described in words another model understands, and it turns that into the structured sentence your text encoder wants. That's the routine job. (Claude Code the agent, editing your graphs over MCP, is a different tool with a different shape. This node is narrow: text in, text out.)

What actually happens when you hit Run

The mechanism matters here because it explains the latency. The node locates the Claude binary - first claude on PATH, then a few usual hiding places (~/.local/bin, ~/.claude/local, /opt/homebrew/bin, /usr/local/bin) - and if it can't, it errors out and tells you to install and sign in, which is exactly what's wrong.

If you've connected images, it writes each one to a throwaway temp directory as a PNG, prefixes your prompt with instructions to read those files off disk, and adds --allowedTools Read so the CLI can do it without stopping to ask. Then it runs a headless claude -p ... --output-format json, reads the result field out of the returned JSON, and hands it back as a string. Your system_prompt gets appended via --append-system-prompt; --model is only passed when you pick something other than default.

That image path is why the README warns about roughly 5–6 seconds per call minimum. Claude isn't receiving a base64 blob - it's being told to open files with a tool, one round trip per image, then answer. It's reliable and it's not fast.

The fields you'll actually touch

prompt is the job. system_prompt is the one beginners leave blank and regret: since the output goes straight into a CLIP Text Encode, an unstyled chat reply drags its own furniture in with it - "Here's your enhanced prompt:" and markdown wrapping become literal conditioning tokens. Fill it. Something like Reply with only the prompt text, no preamble. is the whole trick, and the pack's own tooltip suggests exactly that.

model is default, opus, sonnet or haiku - aliases, not pinned model IDs, so it keeps working as Claude Code's underlying models move. timeout_seconds defaults to 300 (range 30–3600, stepped by 30) and is your dial when multi-image calls time out. seed is not sent to Claude at all - it exists purely to bust ComfyUI's cache so you get a fresh reply when nothing else changed. image_1 is optional, and connecting it makes image_2 appear, up to image_16.

Output is one text STRING. Wire it to the text input of a CLIP Text Encode (right-click → Convert widget to input) or preview it with a Show Text node.

Install

ComfyUI Manager is the easy road: search "SF ComfyUI Nodes" and install. Manually:

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

Then restart ComfyUI. This node needs no API key, so you can ignore the pack's config.ini step - that's for the WaveSpeed nodes. The real second install step is Claude Code itself: get it from claude.com/claude-code, run it once, sign in, and make sure it's signed in as the same user that runs ComfyUI, because that's whose PATH and home directory the node searches.

Where people get burned

  • "Claude Code CLI not found." The binary isn't on ComfyUI's PATH and isn't in the four fallback locations. Install it, sign in, restart. If ComfyUI runs as a service or under a different user than your desktop login, this is the failure you'll hit.
  • Timeout errors. Raise timeout_seconds before you rewrite anything - a multi-image call is slow by design.
  • Non-zero exit / empty response. Usually an expired login or a subscription rate limit, and the node surfaces the CLI's stderr so you can tell. This is the ceiling on the whole approach: heavy batches will hit your Claude limits. For thousands of prompts, the pack's sibling SF LLM Chat on a paid API key is the boring alternative.
  • Stale answers. ComfyUI caches node output. Same prompt, same seed, same result - bump seed to force a new one. (Set Preferences → widget control mode to Before, or you'll lose the seed the same way everyone loses a good sampler seed.)
  • Not portable. Share the workflow and the other person needs their own Claude Code install and login.
CategoryStillfront/LLM

Inputs (21)

NameTypeDefaultDescription
promptSTRINGWhat you want Claude to do.
system_promptSTRINGExtra instructions shaping how Claude responds, e.g. 'Reply with only the prompt text, no preamble.' Leave blank to skip.
modelCOMBOdefaultWhich Claude model to use. 'default' uses whatever Claude Code is set to.
timeout_secondsINT30030–3600Give up if Claude has not replied within this long.
seedINT00–4294967295Not sent to Claude. Change it to force a fresh reply instead of reusing ComfyUI's cached result.
image_1optIMAGE—
image_2optIMAGE—
image_3optIMAGE—
image_4optIMAGE—
image_5optIMAGE—
image_6optIMAGE—
image_7optIMAGE—
image_8optIMAGE—
image_9optIMAGE—
image_10optIMAGE—
image_11optIMAGE—
image_12optIMAGE—
image_13optIMAGE—
image_14optIMAGE—
image_15optIMAGE—
image_16optIMAGE—

Outputs (1)

NameTypeDescription
textSTRING—