Map Photos roles to Qwen image_1/image_2 and inject encode tags silently.

Mention phrases become <imageN> only in the TextEncode string; the inspector never shows Comfy tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-26 16:01:49 -05:00
co-authored by Cursor
parent 5c2248a3fd
commit 50319e03a9
4 changed files with 49 additions and 15 deletions
+8 -3
View File
@@ -20,11 +20,16 @@ export function buildQwen21EditKeepStanza(rawInstruction) {
}
/** Enhance off / refusal: ensure the sample prompt is the keep stanza, never PE-only. */
export function ensureQwen21EditPrompt(prompt) {
export function ensureQwen21EditPrompt(prompt, options = {}) {
const text = String(prompt || '').trim()
if (!text) return text
if (/Keep the identity, face, body, pose, and likeness of the person in <image1>/i.test(text)) return text
return buildQwen21EditKeepStanza(text)
let next = /Keep the identity, face, body, pose, and likeness of the person in <image1>/i.test(text)
? text
: buildQwen21EditKeepStanza(text)
if (options.hasImage2 && !/<image2>/i.test(next)) {
next = `${next}\nUse the garment or object in <image2>.`.trim()
}
return next
}
/** PE rewrite looks like a T2I observer caption, not an edit directive. */