mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #923] [MERGED] feat(comfyui): add %reference_image_name% workflow placeholder #4840
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#4840
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/Pasta-Devs/Marinara-Engine/pull/923
Author: @Yasyasyasvil
Created: 5/16/2026
Status: ✅ Merged
Merged: 5/17/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/comfyui-reference-image-upload📝 Commits (3)
e027196feat(comfyui): add %reference_image_name% workflow placeholder21a591fMerge branch 'staging' into feat/comfyui-reference-image-uploadba77085Merge branch 'staging' into feat/comfyui-reference-image-upload📊 Changes
3 files changed (+41 additions, -5 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/client/src/components/connections/ConnectionEditor.tsx(+2 -1)📝
packages/server/src/services/image/image-generation.ts(+38 -4)📄 Description
Linked issue
Closes #922
Why this change
LoadImageis the standard ComfyUI node for loading an image from theinput/directory by filename. Marinara's existing%reference_image%placeholder inlines the image as a base64 string, whichLoadImagecan't read, that path only works with custom decode nodes likeETN_LoadImageBase64. Users running vanilla ComfyUI, or authoring workflows around the built-inLoadImage, currently have no way to use a reference image. ComfyUI already exposesPOST /upload/imagefor exactly this purpose; this PR wires it in.A new
%reference_image_name%placeholder is added. When the workflow JSON contains it, Marinara uploads the reference image to ComfyUI'sinput/folder and substitutes the returned filename, so vanillaLoadImagenodes can use the reference without any custom decode node.The existing
%reference_image%placeholder is unchanged. The two are fully independent: a workflow can use either one, the other, or both in the same workflow.What changed
uploadComfyReferenceImage(base, reference)inpackages/server/src/services/image/image-generation.ts: decodes the existing base64 reference once viadecodeReferenceImage, content-hashes it for a stable filename (marinara-ref-<sha256[:16]>.<ext>), POSTs multipart withoverwrite=true, and returns the name ComfyUI assigns. Content-hashed filenames mean repeat references against the same image don't accumulate ininput/.generateComfyUI: the upload only fires when the workflow JSON contains%reference_image_name%.%reference_image%is still set unconditionally whenever a reference exists, the structural walkerreplaceComfyUiPlaceholdersis a no-op when the placeholder isn't in the workflow, so setting it is free.ETN_LoadImageBase64vs vanillaLoadImage).%reference_image_name%is added to the workflow validator's "unused placeholder" list as its own entry, treated independently from%reference_image%.[Unreleased] / Added.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
LoadImagenode uses"image": "%reference_image_name%". Trigger a generation that supplies a reference image (sprite sheet, avatar, or Roleplay illustrator). Confirm the image generates and amarinara-ref-<hash>.<ext>file appears in ComfyUI'sinput/folder.%reference_image%from the workflow surfaces it under "Unused"; removing%reference_image_name%surfaces that under "Unused"; using only one of the two doesn't flag the other.Docs and release impact
UI evidence (if applicable)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.