mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #159] [MERGED] docs(assets): asset handles bind only to a filename input, never an IMAGE/VIDEO/AUDIO/MASK socket #160
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#160
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/159
Author: @mattmillerai
Created: 9/19/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-15792-asset-handle-filename-docs📝 Commits (5)
4aaeca9docs(assets): state that an asset handle binds only to a filename input, never an IMAGE/VIDEO/AUDIO socket37a69f4docs(assets): list MASK too, and say the socket rule is unenforced3ee8b33docs(changelog): drop the entry, matching how docs-only changes are recorded44ba0a7docs(quickstart): say node "10" is a LoadImage node in the three quickstart snippets8844916docs: say what to bind a handle to in every quickstart copy📊 Changes
5 files changed (+31 additions, -5 deletions)
View changed files
📝
README.md(+17 -1)📝
src/index.ts(+1 -1)📝
src/sdk/assets.ts(+6 -1)📝
src/sdk/client.ts(+1 -1)📝
src/sdk/workflows.ts(+6 -1)📄 Description
ELI-5
If you hand the SDK a photo, it turns into a filename by the time it reaches the server — not an actual decoded image. So you have to give that filename to a node that expects a filename (a loader like
LoadImage), and then wire the loader's picture output into whatever node actually needs the picture. If you instead shove the handle straight onto a node's "image" slot, the server says "OK" when you submit but the job blows up later because that node was handed a piece of text where it wanted a picture. This PR writes that rule down in the docs so nobody hits the trap again.Summary
Docs-only change. The README's Assets example bound an asset handle to a
LoadImagenode but never said that a loader's file widget is the only kind of input a handle may go on. An external team bound handles directly to a partner node's groupedmodel.reference_images.image_1/model.reference_audios.audio_1inputs, got HTTP 200 at submit, and the job died at execution with'str' object has no attribute 'shape'.The reason is server-side: the public API rewrites every
core/ASSETto a filename string, and inference stages files only for loader(class, field)pairs — any other literal is passed straight through to the node as a string. This PR documents the constraint in the places a user would look (README Assets section and quickstart,Workflow.setInput,Asset, and the package-level quickstart TSDoc).Changes
README.md— new paragraph in the "Assets" section, directly after thewf.setInput("10", "image", asset)example, plus a two-nodeLoadImage→ consumer example showing the handle bound to the loader'simagewidget and the loader's output (["10", 0]) linked into the consumer.src/sdk/workflows.ts—setInputJSDoc now notes a handle must be set on a filename input, not an IMAGE/VIDEO/AUDIO/MASK socket, and states plainly that nothing validates this: the binding is accepted at submit and fails at execution.src/sdk/assets.ts— theAssetdoc comment carries the same rule.README.mdquickstart, and the TSDoc copies insrc/sdk/client.tsandsrc/index.ts, which ship in the package) —wf.setInput("10", "image", asset)now carries a comment saying node"10"is aLoadImagenode (44ba0a7); the two shipped TSDoc copies add "bind handles to a loader's file widget", and the first baresetInputin the README Assets section points to the explanation below it (8844916).CHANGELOG.md— unchanged. A### Docsentry was added on the firstcommit and removed again in
3ee8b33:Docsis not one of the six sectionsCONTRIBUTING and the file's own comment enumerate, and every docs-only PR
since the changelog was introduced in #61 (#113, #116, #119) added no entry
at all. The README and TSDoc changes above are the record.
Review round (
37a69f4) addressed two findings raised on the first commit:MASKwas listed in the README but missing from both doc comments, so the README and both doc comments now name the same sockets (the CHANGELOG entry that also carried the mismatch has since been dropped, see above); and "it cannot be set on an IMAGE/VIDEO/AUDIO socket" claimed an enforcement the SDK does not perform —setInputwrites straight tonode.inputs[field]andsubstituteAssetHandlesrecurses the whole graph with no socket awareness — so the wording is now "must be set on …" plus the unenforced / fails-at-execution caveat.No runtime behaviour changes. The SDK has no node schema (the v2 API exposes none), so client-side rejection of a mis-bound handle is deliberately out of scope — this is documentation of an existing server-side constraint, not new enforcement.
Testing
Re-run at
44ba0a7in a clean worktree afterpnpm install --frozen-lockfile:pnpm format:check— clean (85 files)pnpm lint— clean (exit 0)pnpm typecheck— cleanpnpm test— 642 passed, 5 skipped (27 files passed, 1 skipped)pnpm build— cleannode scripts/check-public-repo-hygiene.mjs— OKProvenance
8844916on 2026-09-27 in a clean worktree: format:check clean (85 files); lint exit 0; typecheck clean; test 642 passed / 5 skipped; public-repo-hygiene OK. The build was last run at44ba0a7;8844916changes only comments and README text.check:sdk-parityfails the same way on this branch and onmain(see Deviations).### Docsheading previously flagged here is resolved — the entry was removed in3ee8b33andCHANGELOG.mdis now net-unchanged by this PR. Remaining: thesdk-parity (python surface freshness)check is red on this PR, but it is not caused by this docs-only diff — this branch touches no Python, extractor or parity file. That job re-derives the Python SDK's public surface fromComfy-Org/comfy-python-sdk@main, and that repo landed a publicRouterRunResultclass insrc/comfy_sdk/models.pywhich this repo's extractor rejects by design (scripts/python-surface.mjspinsPYTHON_MODELS_CLASSEStoModels/AsyncModelsso an unknown third class is a hard failure rather than a silently unchecked surface). The sameExtractionErrorfailsmain's own daily scheduled run — every day since 2026-09-18, still red on 2026-09-27 (run 36303209408) — and it is tracked by issue #156 (with an open fix in #167), where the fix belongs (deciding whetherRouterRunResultis part of themodelsnamespace surface or an intentional asymmetry is a call for that issue, not for a docs PR).sdk-parityis not a required status check: the five required checks — Test (node 22), Test (node 24), build-check (publish dry run), public-repo-hygiene and cla-assistant — all pass on this PR (re-read 2026-10-04;main's scheduled run was still red the same way on 2026-10-03, run 37106824538).Residual
'str' object has no attribute 'shape'. Reproducing it requires a live Comfy Cloud server and the partner node, which this SDK repo and worktree cannot exercise; no code path in this diff enforces the claim, so it is documentation of server behaviour grounded in that report.core/ASSET→ filename and the loader-only file-staging logic live in the cloud backend (cloud/common/file_extractor.go,FileNodeFieldName), a different repo not accessible from this sandbox. The paragraph paraphrases that behaviour from the sourcing investigation rather than from reading the code here.Comfy-Org/docsis not included. The same example appears indevelopment/api-development/sdks.mdx(and its ja/ko/zh mirrors) and needs the same paragraph. That repo is out of scope for this change and is a manual follow-on.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.