[PR #9] [MERGED] feat: api_key on submit/run for partner (API) node auth #18

Closed
opened 2026-10-26 22:40:42 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/9
Author: @wei-hai
Created: 7/21/2026
Status: ✅ Merged
Merged: 7/21/2026
Merged by: @wei-hai

Base: main ← Head: feat/extra-data-api-key


📝 Commits (1)

  • c258bd8 feat: api_key on submit/run for partner (API) node auth

📊 Changes

11 files changed (+1393 additions, -17 deletions)

View changed files

➕ .github/CODEOWNERS (+4 -0)
📝 README.md (+18 -0)
📝 scripts/check_public_repo_hygiene.py (+21 -3)
📝 spec/openapi.yaml (+12 -0)
📝 src/comfy_low/transport.py (+19 -3)
📝 src/comfy_sdk/_core.py (+14 -0)
📝 src/comfy_sdk/client.py (+48 -11)
📝 tests/conftest.py (+4 -0)
📝 tests/test_async.py (+17 -0)
📝 tests/test_jobs.py (+40 -0)
➕ uv.lock (+1196 -0)

📄 Description

What

Workflows that use partner/API nodes (Gemini, etc.) authenticate with a single Comfy API key carried in the POST /api/v2/jobs body as extra_data.api_key_comfy_org. This adds an optional api_key= parameter to submit()/run() (both sync Comfy and async AsyncComfy) that packs the key into a typed, closed extra_data object sent alongside the workflow.

job = client.run(wf, api_key="comfyui-...")
  • Omit api_key and no extra_data is sent (never an empty object).
  • The key never participates in idempotency and is never logged or persisted by the SDK — it flows only into the httpx request body.
  • A shared sans-IO helper keeps sync/async parity.
  • README documents the field and disambiguates it from the client-constructor api_key (which authenticates you to the server); the two are often the same key but conceptually distinct.

Tests

New sync + async tests prove extra_data.api_key_comfy_org appears as a sibling of workflow when a key is given, is absent when not, and that run() forwards it through. pytest — 34 passed; ruff check, ruff format --check, mypy clean.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-python-sdk/pull/9 **Author:** [@wei-hai](https://github.com/wei-hai) **Created:** 7/21/2026 **Status:** ✅ Merged **Merged:** 7/21/2026 **Merged by:** [@wei-hai](https://github.com/wei-hai) **Base:** `main` ← **Head:** `feat/extra-data-api-key` --- ### 📝 Commits (1) - [`c258bd8`](https://github.com/Comfy-Org/comfy-python-sdk/commit/c258bd8ee36728ec26f495c4e439aa8892dd15ce) feat: api_key on submit/run for partner (API) node auth ### 📊 Changes **11 files changed** (+1393 additions, -17 deletions) <details> <summary>View changed files</summary> ➕ `.github/CODEOWNERS` (+4 -0) 📝 `README.md` (+18 -0) 📝 `scripts/check_public_repo_hygiene.py` (+21 -3) 📝 `spec/openapi.yaml` (+12 -0) 📝 `src/comfy_low/transport.py` (+19 -3) 📝 `src/comfy_sdk/_core.py` (+14 -0) 📝 `src/comfy_sdk/client.py` (+48 -11) 📝 `tests/conftest.py` (+4 -0) 📝 `tests/test_async.py` (+17 -0) 📝 `tests/test_jobs.py` (+40 -0) ➕ `uv.lock` (+1196 -0) </details> ### 📄 Description ## What Workflows that use partner/API nodes (Gemini, etc.) authenticate with a single Comfy API key carried in the `POST /api/v2/jobs` body as `extra_data.api_key_comfy_org`. This adds an optional `api_key=` parameter to `submit()`/`run()` (both sync `Comfy` and async `AsyncComfy`) that packs the key into a typed, closed `extra_data` object sent alongside the workflow. ```python job = client.run(wf, api_key="comfyui-...") ``` - Omit `api_key` and **no `extra_data` is sent** (never an empty object). - The key **never participates in idempotency** and is **never logged or persisted** by the SDK — it flows only into the httpx request body. - A shared sans-IO helper keeps sync/async parity. - README documents the field and disambiguates it from the client-constructor `api_key` (which authenticates *you* to the server); the two are often the same key but conceptually distinct. ## Tests New sync + async tests prove `extra_data.api_key_comfy_org` appears as a sibling of `workflow` when a key is given, is absent when not, and that `run()` forwards it through. `pytest` — 34 passed; `ruff check`, `ruff format --check`, `mypy` clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:40:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-python-sdk#18
No description provided.