Add optional reference photo conditioning to Flux generation

This commit is contained in:
Towsty
2026-09-06 23:05:36 -05:00
parent bb91b4fd3f
commit 53bb58bbd5
7 changed files with 66 additions and 15 deletions
+4 -1
View File
@@ -1149,6 +1149,9 @@ async function startStudioEditJob(item: StudioJob) {
}
: null
const refId = payload.referenceStillId
if (refId && !existsSync(stillPath(item.ownerKey, refId))) {
throw new Error('The reference photo is missing from the library')
}
const reference = refId && existsSync(stillPath(item.ownerKey, refId))
? {
filename: payload.referenceStillFilename || 'image2.png',
@@ -1230,7 +1233,7 @@ async function startStudioEditJob(item: StudioJob) {
engine: v2Engine,
task: payload.v2Task || (graphMode === 'generate' ? 't2i' : 'scene'),
image: graphMode === 'generate' ? null : image,
reference: graphMode === 'compose' ? reference : null,
reference: graphMode === 'compose' || (graphMode === 'generate' && v2Engine === 'flux') ? reference : null,
mask,
prompt: payload.prompt,
negative: payload.negative || '',