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:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user