comfy-sdk

comfy-sdk is a skill for Claude Code from Comfy-Org/comfy-skills. It costs 96 tokens per session (2,431 once invoked), scanned A, original, MIT.

A coding guide for adding image, video, or audio generation to an application through Comfy Router and the Comfy SDK. It covers both Python and TypeScript, and explains the separate Router and Cloud clients.

In plain words
What is it for?
It helps configure the SDK, discover current model details at runtime, and run generation requests from Python or TypeScript applications.
Why use it?
It prevents common integration mistakes, such as using the wrong client, host, credentials, or model information.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the comfy-sdk plugin — 1 skill shipped together

Good fit It helps configure the SDK, discover current model details at runtime, and run generation requests from Python or TypeScript applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/comfy-org/comfy-skills/comfy-sdk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Comfy-Org/comfy-skills --skill comfy-sdk
Clone the repo
git clone --depth 1 https://github.com/Comfy-Org/comfy-skills

Made for: Claude Code.

Or install comfy-sdk, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for comfy-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/comfy-org/comfy-skills/comfy-sdk/github.svg)](https://agentmods.dev/skills/comfy-org/comfy-skills/comfy-sdk)
Your own site
<a href="https://agentmods.dev/skills/comfy-org/comfy-skills/comfy-sdk"><img src="https://agentmods.dev/badge/skills/comfy-org/comfy-skills/comfy-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for comfy-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/comfy-org/comfy-skills/comfy-sdk"><img src="https://agentmods.dev/badge/skills/comfy-org/comfy-skills/comfy-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,431 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00096 $0.02431
Opus 5.5 $0.00038 $0.00972
Sonnet 5.5 $0.00019 $0.00486
Haiku 4.5 $0.00010 $0.00243

Measured 20d ago against content hash b2bb51a65a48, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

comfy-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude-code-sdk/skills/comfy-sdk/SKILL.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.

comfy-sdk — build with Comfy Router

Steering only. Model names, schemas, prices and default timeouts change: discover them at run time (section 3) or read them off the installed SDK, and never paste one from memory.

1. Pick the right client

  • Router (partner models, https://api.comfy.org) is reached through the models namespace:
    • Python: Comfy().models (AsyncComfy().models for asyncio).
    • TypeScript: the module-level comfy.models, after comfy.config({ credentials }) or with COMFY_API_KEY set. new Comfy({ apiKey }) is the Comfy Cloud workflow client and has no .models.
  • Cloud (/api/v2/jobs, run a ComfyUI workflow) is the class client in both SDKs.
  • Both use the same COMFY_API_KEY. Hosts are separate: COMFY_ROUTER_BASE_URL redirects Router, COMFY_BASE_URL redirects Cloud. Leave both unset in production.
from comfy_sdk import Comfy

client = Comfy()  # reads COMFY_API_KEY
result = client.models.run("<provider>/<model>", {<provider's native body>})
import { comfy } from "@comfyorg/sdk";

comfy.config({ credentials: process.env.COMFY_API_KEY });
const { kind, data, requestId } = await comfy.models.run("<provider>/<model>", {<native body>});

2. Credentials stay on the server

  • The SDKs read COMFY_API_KEY from the process environment; neither loads a .env file. Your framework does that (python-dotenv, Next.js .env.local, etc.). An explicit api_key= / credentials argument always wins over the variable.
  • Never expose the key to a browser bundle (no NEXT_PUBLIC_ / VITE_ prefix). Call Router from a server route and return the result to the page.
  • Preflight before any paid call: list models (section 3). A 401 there means the key, not the model, is wrong.

3. Discover, then call

  • GET /v2/models lists what the credential can run, with billing facts. Paginate with next_cursor while has_more is true; treat cursors as opaque.
  • GET /v2/models/{provider}/{model}/openapi.json is that model's input/output schema. The second argument to run / submit is the provider's native body, forwarded unchanged, so build it from this schema, not from another provider's shape.
  • TypeScript wraps both: comfy.models.list() walks the catalog and comfy.models.schema(model) fetches the document. In Python, if the installed client.models has no such helper, call the two routes on the Router host yourself with Authorization: Bearer <COMFY_API_KEY>.
  • A model id is exactly two segments, provider/model.

Read the full file on GitHub · 175 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago First seen · 175 lines · 96 tokens per session scan A b2bb51a65a48

Subscribe to this mod's changes

comfy-sdk is a skill published in the GitHub repository Comfy-Org/comfy-skills (273 stars, last pushed today), licensed MIT. It adds 96 tokens to every session and 2,431 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-11.

Related

comfy-sdk compared with skills from other repositories

comfy-sdk next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
comfy-sdkComfy-Org/comfy-skillsSkill273todayMITA96Claude Code
build-mcp-serveranthropics/claude-plugins-officialSkill49ktodayApache-2.0A111Claude Code
data-manager-api-troubleshootinggoogle/skillsSkill25ktodayApache-2.0A179Claude Code, Codex
data-manager-api-setupgoogle/skillsSkill25ktodayApache-2.0A118Claude Code, Codex
vss-manage-video-io-storageNVIDIA-AI-Blueprints/video-search-and-summarizationSkill2.0ktodayApache-2.0A143Claude Code, Codex
workers-best-practicescloudflare/skillsSkill3.5k5d agoApache-2.0A25Claude Code
vss-search-archiveNVIDIA-AI-Blueprints/video-search-and-summarizationSkill2.0ktodayApache-2.0A67Claude Code, Codex