mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #45] [CLOSED] feat: add embed_workflow to embed the graph in output metadata #53
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#53
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/45
Author: @wei-hai
Created: 8/12/2026
Status: ❌ Closed
Base:
main← Head:wei/be-7128-embed-workflow-metadata📝 Commits (1)
8983b26feat: add embed_workflow option to embed the API-format graph in output metadata📊 Changes
5 files changed (+140 additions, -14 deletions)
View changed files
📝
README.md(+25 -1)📝
src/comfy_sdk/_core.py(+17 -8)📝
src/comfy_sdk/client.py(+13 -5)📝
tests/test_async.py(+28 -0)📝
tests/test_jobs.py(+57 -0)📄 Description
Recovering the workflow from an image it produced isn't possible today, which makes debugging harder. Adds an opt-in flag.
submit()andrun()— sync and async — take a keyword-onlyembed_workflow: bool = False. When set, the SDK sends the materialized graph asextra_data.extra_pnginfo.workflow, the key local ComfyUI'sSaveImagewrites into output PNG metadata.Behavior
api_keyand the flag off, the wire format is byte-identical to today: noextra_dataat all, never{}. Existing tests pinning this are untouched.workflow— not the caller's input. A test asserts thecore/ASSETsubstitution actually happened, so it can't pass by embedding the wrong object.Reviewer notes
spec/openapi.yamlis untouched by design (synced one-way); it picks the field up on the next sync.embedWorkflow, producing identical bytes.ruff,mypy,pytest(133 passed, 4 pre-existing skips), spec-drift and hygiene checks all clean.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.