mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #3] [MERGED] @comfyorg/sdk (TypeScript): the Comfy API v2 client — two-layer SDK #12
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
bug
cursor-review-pin
effort:medium
effort:small
effort:trivial
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-typescript-sdk#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-typescript-sdk/pull/3
Author: @wei-hai
Created: 7/16/2026
Status: ✅ Merged
Merged: 7/17/2026
Merged by: @wei-hai
Base:
main← Head:feat/full-v2📝 Commits (8)
01ac0c7Build the full two-layer Comfy API v2 SDK6eaa69cScrub internal references from the vendored specdca70f8Fix must-fix review findings: bearer-token leak, missing abort support, untested auth06fabd7Expand README and close test gaps for the v2 SDK88b6bd9docs: correct submit() idempotency JSDocdaada4dSync to the current v2 contract: drop replay/409 idempotency, reject-on-duplicate7208839README: drop removed IdempotencyConflict; document single-use idempotency1726984ci: add public-repo hygiene guard + publish-readiness check📊 Changes
45 files changed (+6122 additions, -81 deletions)
View changed files
📝
.github/workflows/ci.yml(+61 -0)📝
.oxlintrc.json(+1 -1)➕
.prettierignore(+6 -0)📝
README.md(+220 -18)➕
openapi-ts.config.ts(+42 -0)📝
package.json(+18 -3)📝
pnpm-lock.yaml(+596 -14)➕
scripts/check-public-repo-hygiene.mjs(+164 -0)➕
scripts/check-spec-drift.mjs(+63 -0)➕
spec/README.md(+1 -0)➕
spec/VERSION(+1 -0)➕
spec/openapi.yaml(+944 -0)📝
src/index.test.ts(+11 -6)📝
src/index.ts(+23 -39)➕
src/low/errors.test.ts(+60 -0)➕
src/low/errors.ts(+144 -0)➕
src/low/generated/index.ts(+3 -0)➕
src/low/generated/types.gen.ts(+591 -0)➕
src/low/generated/zod.gen.ts(+238 -0)➕
src/low/index.ts(+28 -0)...and 25 more files
📄 Description
What this is
The TypeScript SDK for running ComfyUI workflows via the Comfy API v2 — the same code against a self-hosted ComfyUI, Comfy Cloud, or a serverless deployment. Only the base URL and (where needed) an API key change. It mirrors the Python SDK's surface so the two behave identically.
Two layers
low: types + Zod generated from the Comfy API v2 OpenAPI contract (spec/openapi.yaml, a synced copy), plus a hand-writtenfetchtransport. The codegen tool's generated client was evaluated against the hard requirements (rawResponse, unbuffered streaming, streaming upload body, per-request abort); since three of the nine operations (multipart upload, SSE, ranged download) must bypass a generated call-site to use those anyway, the transport is hand-written for all nine — matching the Python SDK's architecture. A drift check + spec-coverage test keeplowin sync with the contract.sdk: the idiomatic layer — content-addressed upload with blake3 (hash-wasm) dedup,core/ASSETsubstitution, poll-authoritativerun()/wait(), a reconnecting typed SSE stream (eventsource-parserover the raw fetch body, since theEventSourceglobal can't send headers or abort), range-aware downloads, and typed errors for every code.Notes for reviewers
fs.openAsBlob()(disk-backed, never buffered whole).Tests
76 tests across 11 files against a stub server, covering the same scenarios as the Python SDK: dedup fast-path, streaming upload, hash-mismatch without blind retry, poll-only completion, SSE reconnect without replay, idempotent submit, error→exception mapping, ranged download. CI green on Node 22 and 24.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.