mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1275] [Issue]: ComfyUI image gen only substitutes the first reference image; indexed placeholders (%reference_image_name_02%) leak as plaintext #621
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#621
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 @GetBeholder on GitHub (May 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1275
Originally assigned to: @cha1latte on GitHub.
Summary
When generating images through a ComfyUI connection whose workflow uses
multiple reference images, Marinara Engine only handles the first reference
image. Indexed reference placeholders such as
%reference_image_name_01%and%reference_image_name_02%are never substituted, so they are sent to ComfyUI asliteral text and ComfyUI rejects the input. With "Send character & persona
avatars as reference images" checked, the second avatar is effectively not sent.
Expected behavior
A ComfyUI workflow that uses multiple indexed reference placeholders
(
%reference_image_name_01%,%reference_image_name_02%, …) should have eachplaceholder substituted with its corresponding uploaded reference image (for
example the character avatar and the persona avatar). When a reference slot has
no image, the graceful/empty-pixel fallback should apply to every slot — not
only the first — so no placeholder is ever sent to ComfyUI as raw text.
Actual behavior
Only
%reference_image_name%is substituted, and only with the first referenceimage. Indexed placeholders (
_01,_02, …) are not recognized and pass throughunchanged, so ComfyUI receives e.g.
%reference_image_name_02%as plaintext andthrows an input error (there is no error for the first/
_01). Per contributordiagnosis, the empty-pixel fallback for a missing reference image also only
applies to the first reference image.
Steps to reproduce
images, using
%reference_image_name_01%and%reference_image_name_02%.images" and use the Illustrator agent (or chat image gen with two references).
%reference_image_name_02%arrives as literal text; the first reference is fine.
%reference_image_name%→ image gen works, butonly one image is used.
Workaround (reporter): use both
%reference_image_name%and%reference_image_name_01%together. Per contributor Yas,%reference_image_name%is an alias for
_01, so this sends the same image twice. Recommended as astopgap "until a proper fix is implemented."
Impact area
Environment
Logs, screenshots, or video
The reporter attached a ComfyUI workflow file (
ComfyUI_Workflow.txt, ~361lines) and screenshots of the Illustrator agent and custom prompt in the
original thread. These were not provided here as files or URLs, so they are not
attached. The custom Illustrator agent prompt outputs a
charactersarray usedto attach each character's / the persona's avatar as a visual reference, and the
reporter notes the workflow works correctly in ComfyUI directly and for
single-reference avatar generation in the character galleries.
Regression notes
Not provided.
Additional context
Source: forum thread started by FluffiStuf [DOKI] (1-Star), with diagnosis by
Pasta Contributor Yas (~May 25, 2026). Yas confirmed the empty-pixel fallback for
a missing reference only works for the first reference image, and recommended the
alias workaround until a proper fix lands.
Code pointer (from a scan, not from the reporter):
src-tauri/src/commands/storage/images/providers.rs→generate_comfyui(~L1620).It builds workflow replacements using only
options.reference_images.first()(L1652) and substitutes only the
%reference_image_name%token, again with.first()(L1654-1661). There is no handling for indexed placeholders(
%reference_image_name_01/02/...%) or for additional reference images, somulti-reference workflows leave the indexed tokens unsubstituted and
replace_workflow_placeholderspasses the literal tokens through to ComfyUI.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: