Skip to content

Multiple image inputs collapse to "last image wins" in submitJob #16

Description

@mattmillerai

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:

  1. Keyed mapping — associate each image input (by index/identifier) with a specific `LoadImage` node and patch only that node.
  2. Interim guard — reject >1 image input with a clear `ComfyError` until keyed mapping exists:

```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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions