[GH-ISSUE #1018] [Feature]: Support multiple ComfyUI reference images via numbered placeholders #495

Closed
opened 2026-10-20 17:29:30 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Yasyasyasvil on GitHub (May 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1018

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

ComfyUI workflows can use only one reference image today. The existing %reference_image% and %reference_image_name% placeholders always resolve to the first reference image, any additional references the caller supplies are silently dropped. Workflows that need more than one reference (group scenes, multi-character compositions, etc...) have no way to wire up the extra slots.

Proposed solution

Add numbered variants of both placeholders, capped at 4 to match the existing 4-reference limit already used by avatar and sprite generation:

  • %reference_image_01% through %reference_image_04%
  • %reference_image_name_01% through %reference_image_name_04%

For backward compatibility, %reference_image% is an alias for %reference_image_01%, and %reference_image_name% for %reference_image_name_01%, existing workflows keep working unchanged.

Alternatives considered

  • Unbounded numeric suffixes: more flexible, but adds validator complexity and a potentially unbounded upload loop. The cap-at-4 design aligns with what the avatar / sprite UIs already enforce upstream.

Additional context

NA

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Yasyasyasvil on GitHub (May 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1018 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? ComfyUI workflows can use only one reference image today. The existing `%reference_image%` and `%reference_image_name%` placeholders always resolve to the first reference image, any additional references the caller supplies are silently dropped. Workflows that need more than one reference (group scenes, multi-character compositions, etc...) have no way to wire up the extra slots. ## Proposed solution Add numbered variants of both placeholders, capped at 4 to match the existing 4-reference limit already used by avatar and sprite generation: - `%reference_image_01%` through `%reference_image_04%` - `%reference_image_name_01%` through `%reference_image_name_04%` For backward compatibility, `%reference_image%` is an alias for `%reference_image_01%`, and `%reference_image_name%` for `%reference_image_name_01%`, existing workflows keep working unchanged. ## Alternatives considered - **Unbounded numeric suffixes**: more flexible, but adds validator complexity and a potentially unbounded upload loop. The cap-at-4 design aligns with what the avatar / sprite UIs already enforce upstream. ## Additional context NA ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@cha1latte commented on GitHub (May 19, 2026):

Triage note: labeling this as normal-scope because it is a focused ComfyUI placeholder enhancement for an existing image-generation workflow path, capped to the current 4-reference limit and preserving backward compatibility.

This can stay in the normal enhancement backlog as a bounded ComfyUI compatibility improvement.

<!-- gh-comment-id:4489966950 --> @cha1latte commented on GitHub (May 19, 2026): Triage note: labeling this as `normal-scope` because it is a focused ComfyUI placeholder enhancement for an existing image-generation workflow path, capped to the current 4-reference limit and preserving backward compatibility. This can stay in the normal enhancement backlog as a bounded ComfyUI compatibility improvement.
Author
Owner

@SpicyMarinara commented on GitHub (May 23, 2026):

Implemented in the local fix pass.

What changed:

  • Local ComfyUI workflows now replace %reference_image_01% through %reference_image_04% and %reference_image_name_01% through %reference_image_name_04%.
  • %reference_image% and %reference_image_name% remain aliases for slot 01.
  • Each referenced name slot uploads its matching image to ComfyUI only when that name placeholder is present in the workflow.
  • RunPod ComfyUI now supports numbered base64 %reference_image_01% through %reference_image_04% placeholders as well.
  • Connection editor/help text and CHANGELOG.md were updated.

Validation run:

  • pnpm --filter @marinara-engine/server lint
  • pnpm --filter @marinara-engine/client lint
<!-- gh-comment-id:4524882466 --> @SpicyMarinara commented on GitHub (May 23, 2026): Implemented in the local fix pass. What changed: - Local ComfyUI workflows now replace `%reference_image_01%` through `%reference_image_04%` and `%reference_image_name_01%` through `%reference_image_name_04%`. - `%reference_image%` and `%reference_image_name%` remain aliases for slot 01. - Each referenced name slot uploads its matching image to ComfyUI only when that name placeholder is present in the workflow. - RunPod ComfyUI now supports numbered base64 `%reference_image_01%` through `%reference_image_04%` placeholders as well. - Connection editor/help text and CHANGELOG.md were updated. Validation run: - `pnpm --filter @marinara-engine/server lint` - `pnpm --filter @marinara-engine/client lint`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#495
No description provided.