mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #5] [MERGED] comfy-sdk (Python): the Comfy API v2 client — two-layer SDK #13
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
effort:medium
effort:small
effort:small
effort:trivial
priority:nice-to-have
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-python-sdk#13
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-python-sdk/pull/5
Author: @wei-hai
Created: 7/16/2026
Status: ✅ Merged
Merged: 7/17/2026
Merged by: @wei-hai
Base:
main← Head:feat/full-v2📝 Commits (10+)
83c6f4eAdd demo-slice v2 client (submit / poll / download)dbd44a3Make API key optional per surface; clear error when requiredca1261bWrap run() signature to satisfy the 100-char line limitc84093aScrub internal references from README and docstringdc6c60fAdd CI (ruff, mypy, pytest) and a dormant PyPI publish workflow (#2)df9a42dExpand demo client into the full two-layer Comfy API v2 SDK0c6bfa4Reconcile vendored spec to the canonical Comfy API v2 contract6842e22Fix 3 must-fix review findings: token leak, broken async upload, dropped tags82e17a1Polish README for developer onboarding; close test gaps in redirect/auth/retry paths827d0c9docs: correct submit() idempotency docstring📊 Changes
37 files changed (+5301 additions, -14 deletions)
View changed files
➕
.github/workflows/ci.yml(+112 -0)➕
.github/workflows/publish.yml(+68 -0)📝
README.md(+195 -14)➕
pyproject.toml(+61 -0)➕
scripts/check_drift.py(+68 -0)➕
scripts/check_public_repo_hygiene.py(+158 -0)➕
scripts/gen_models.sh(+25 -0)➕
spec/README.md(+1 -0)➕
spec/VERSION(+1 -0)➕
spec/openapi.yaml(+936 -0)➕
src/comfy_low/__init__.py(+86 -0)➕
src/comfy_low/_multipart.py(+99 -0)➕
src/comfy_low/errors.py(+141 -0)➕
src/comfy_low/models/__init__.py(+47 -0)➕
src/comfy_low/models/_generated.py(+257 -0)➕
src/comfy_low/sse.py(+70 -0)➕
src/comfy_low/transport.py(+572 -0)➕
src/comfy_sdk/__init__.py(+95 -0)➕
src/comfy_sdk/_core.py(+93 -0)➕
src/comfy_sdk/_hashing.py(+42 -0)...and 17 more files
📄 Description
What this is
The Python 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.
Two layers
comfy_lowis generated from the Comfy API v2 OpenAPI contract (spec/openapi.yaml, a synced copy) plus a small hand-writtenhttpxtransport. It's boring and regenerated wholesale; a drift check + a spec-coverage test keep it in sync with the contract.comfy_sdkis the hand-written layer that carries the actual value: content-addressed upload with local blake3 dedup,core/ASSETsubstitution into the raw graph, poll-authoritativerun()/wait(), a reconnecting typed SSE event stream, range-aware downloads, and typed exceptions for every error code.Notes for reviewers
Tests
28 tests against a stub server: dedup fast-path, streaming upload (asserted not buffered whole), hash-mismatch surfaced without blind retry, poll-only completion, SSE reconnect without replay, idempotent submit, error→exception mapping, ranged download — plus the async mirrors.
ruff/mypy/ drift check clean.Deferred (noted)
Preview.to_pil()needs an optional image extra; browser support is out of scope for v1 (Node/Python runtimes).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.