mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3803] [MERGED] Suppress the reference-image prompt line for local SD backends (ComfyUI/A1111/Draw Things) #6109
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#6109
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/3803
Author: @kh0p
Created: 7/19/2026
Status: ✅ Merged
Merged: 7/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/suppress-reference-line-local-sd📝 Commits (4)
697ec11Suppress the reference-image prompt line for local SD backends22dcc90Merge branch 'staging' into fix/suppress-reference-line-local-sde0ce68eMerge branch 'staging' into fix/suppress-reference-line-local-sdf746c6ffix: address reference prompt review feedback📊 Changes
6 files changed (+143 additions, -32 deletions)
View changed files
📝
packages/server/src/routes/gallery.routes.ts(+11 -8)📝
packages/server/src/routes/generate.routes.ts(+11 -8)📝
packages/server/src/routes/generate/retry-agents-route.ts(+11 -8)📝
packages/server/src/services/generation/conversation-selfie-command-runtime.ts(+11 -8)📝
packages/server/src/services/image/illustrator-references.ts(+65 -0)📝
scripts/regressions/prompt.regression.ts(+34 -0)📄 Description
Problem
When avatar references are attached, the engine appends a prose line to the image prompt:
For ComfyUI / AUTOMATIC1111 / Draw Things connections the reference images travel out-of-band (ComfyUI upload endpoint / img2img payload), and the CLIP text encoder cannot act on an instruction sentence — it just tokenizes it. On tag-trained SDXL checkpoints (Pony/Illustrious) this costs ~40 of the strongest prompt tokens and measurably dilutes tag adherence, especially with CLIP's 77-token chunking.
NovelAI connections already suppress this line (
isNovelAiImageConnection) for the same underlying reason: the provider consumes references natively, so the sentence is invisible to the model.Change
suppressesReferencePromptLine()inservices/image/illustrator-references.ts— returns true for NovelAI (delegating to the existing predicate) and for local SD backends, detected via explicitimageService/imageGenerationSourceids (comfyui,automatic1111,drawthings) plus the default local ports (:8188,:7860) in the base URL, mirroring the style of the NovelAI check.suppressReferencePromptLinecall sites (generate route, retry-agents route, gallery route, selfie command runtime) use the new function instead ofisNovelAiImageConnectiondirectly.isNovelAiImageConnectionremains exported and unchanged.Notes
🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.