mirror of
https://github.com/Comfy-Org/comfy-swift-sdk.git
synced 2026-11-04 23:47:26 +00:00
[GH-ISSUE #16] Multiple image inputs collapse to "last image wins" in submitJob #3
Labels
No labels
enhancement
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-swift-sdk#3
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?
Originally created by @mattmillerai on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-swift-sdk/issues/16
Surfaced by CodeRabbit on #10 (pre-existing logic; tracked here, not fixed in that comment-only PR).
`Transport.submitJob` loops over `request.inputs` and, for each `.image`, calls `patchLoadImageNodes(...)` which rewrites every `LoadImage` node in the workflow JSON. With more than one image input, each iteration overwrites the previous binding, so all `LoadImage` nodes end up pointing at the last uploaded filename.
Options:
```swift
if request.inputs.filter({ if case .image = $0 { return true }; return false }).count > 1 {
throw ComfyError.serverRejected(reason: .other("Multiple image inputs are not yet supported in a single request"))
}
```
Acceptance: a two-image request either binds each to its intended node, or fails fast with a descriptive error (no silent last-wins). Add a unit test covering the multi-image case.
@mattmillerai commented on GitHub (Jun 21, 2026):
Interim guard merged in #22:
submitJobnow fails fast withComfyError.serverRejected(.other("multiple_image_inputs_unsupported"))on >1 image input, so the silent "last image wins" behaviour is gone.Remaining scope for this issue (kept open): keyed input→node mapping — associate each image input with a specific
LoadImagenode (by index/identifier) and patch only that node, so multi-image requests bind correctly instead of being rejected. Good candidate for 0.2.0.