mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #52] [MERGED] docs: document fromJson/fromString and kind-typed (audio) outputs #61
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#61
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/52
Author: @mattmillerai
Created: 8/13/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-7454-readme-programmatic-graph-outputs📝 Commits (1)
26ac63ddocs: document fromJson/fromString and kind-typed (audio) outputs📊 Changes
1 file changed (+69 additions, -0 deletions)
View changed files
📝
README.md(+69 -0)📄 Description
ELI-5
The README only ever showed one way to build a workflow (read a
workflow_api.jsonoff disk) and only ever showed image outputs. The SDK has done more than that for a while:client.workflowsalso takes a graph you built in code or a JSON string you already hold, and every job output carries a kind — image, video, audio, text, file or latent. This adds both to the README so you do not have to read the SDK source to find them.What changed
Docs only — one file,
README.md, no source or behavior touched.await client.workflows.fromFile(path),client.workflows.fromJson(graph),client.workflows.fromString(text)— plus a worked example that builds an API-format graph in code, callssetInputon it, andruns it. It also states the two things that bite first:fromJsonuses the object as-is rather than copying it, and none of the three validates the graph (a UI-format export is caught at submit time withWorkflowFormatUi, before any request goes out).out.typeis"image" | "video" | "audio" | "text" | "file" | "latent", alongsideout.contentType, with a non-image example — reading aSaveAudioMP3node's output to disk, and handinggetDownloadUrl()straight to a browser<audio>element so the bytes never pass through the caller's process.The union documented is the full six-member
OutputTypefrom the spec, not a four-member subset.Verification
pnpm format:check,pnpm lint,pnpm typecheck,pnpm test— all green (169 tests, 16 files)..mtsfile and typechecked under--stricttwice: once against this branch'ssrc/, and once against the published@comfyorg/sdk@0.1.7installed from npm in a clean scratch project. Both exit 0. Thetrack.type === "audio"narrowing and every property accessed (type,contentType,toFile,getDownloadUrl,workflows.fromJson/fromString/fromFile,wf.json) resolve against the published types.OutputTypein the publisheddist/low/generated/types.gen.d.tsis byte-identical to the one in this tree, so the union printed in the README is accurate for anyone on the current release.src/sdk/workflows.tsandsrc/sdk/outputs.tsrather than invented. One correction worth flagging: the discriminator is thetypeaccessor onOutput—kindis the SSE event discriminator (event.kind), a different thing — so the README saysout.type.<audio>/<video>element on Cloud/serverless, and that on a self-hosted proxy it is the content URL with normal auth still applying. An unqualified version of that sentence would have contradicted the paragraph directly below it.Notes / judgment calls
fromJson/fromStringand no audio/video coverage, so it does not cover this gap — but whichever of the two lands second will need a rebase. Flagging rather than resolving, since #37 is someone else's draft.fromFile, deliberately: file-on-disk is the right first example, and the new section sits immediately below it.Docs-only, so there is nothing to feature-flag and no test to add beyond the compile checks above.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.