Show Flux and Krea as Image v2 engine cards, and run Krea on edit, compose, and refine.
Krea image-to-image uses encode plus denoise graphs, not Klein reference latents, and still fails closed if the Krea models are missing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -65,16 +65,12 @@ export async function runEditV2(job: Job, params: EditV2RunParams) {
|
||||
|
||||
await withImageComfyHost(job.imageComfyHost, async () => {
|
||||
const generate = params.mode === 'generate'
|
||||
const engine = generate ? parseImageV2Engine(params.engine, 'flux') : 'flux'
|
||||
if (engine === 'krea' && params.mode !== 'generate') {
|
||||
throw new Error('Krea is available on Generate first.')
|
||||
}
|
||||
const engine = parseImageV2Engine(params.engine, 'flux')
|
||||
const engineLabel = engine === 'krea' ? 'Krea' : 'Flux'
|
||||
emitChainJob(job, {
|
||||
type: 'status',
|
||||
message: generate
|
||||
? engine === 'krea'
|
||||
? 'Queueing Krea generate on Beast...'
|
||||
: 'Queueing Flux generate on Beast...'
|
||||
? `Queueing ${engineLabel} generate on Beast...`
|
||||
: params.mode === 'refine'
|
||||
? 'Uploading canvas and mask to Beast...'
|
||||
: params.mode === 'compose' ? 'Uploading stills A and B to Beast...' : 'Uploading still A to Beast...',
|
||||
@@ -101,10 +97,10 @@ export async function runEditV2(job: Job, params: EditV2RunParams) {
|
||||
emitChainJob(job, {
|
||||
type: 'status',
|
||||
message: params.mode === 'refine'
|
||||
? 'Queueing Klein v2 refine on Beast...'
|
||||
? `Queueing ${engineLabel} v2 refine on Beast...`
|
||||
: params.mode === 'compose'
|
||||
? `Queueing Klein v2 compose (${params.task}) on Beast...`
|
||||
: 'Queueing Klein v2 edit on Beast...',
|
||||
? `Queueing ${engineLabel} v2 compose (${params.task}) on Beast...`
|
||||
: `Queueing ${engineLabel} v2 edit on Beast...`,
|
||||
progress: 12
|
||||
})
|
||||
}
|
||||
@@ -165,7 +161,7 @@ export async function runEditV2(job: Job, params: EditV2RunParams) {
|
||||
isCancelled: () => job.status === 'cancelled'
|
||||
})
|
||||
|
||||
emitChainJob(job, { type: 'status', message: 'Saving Klein v2 still...', progress: 94 })
|
||||
emitChainJob(job, { type: 'status', message: `Saving ${engineLabel} v2 still...`, progress: 94 })
|
||||
const buffer = await downloadEditedImage(output)
|
||||
const size = imageDimensions(buffer)
|
||||
const still = await saveStill({
|
||||
@@ -193,7 +189,7 @@ export async function runEditV2(job: Job, params: EditV2RunParams) {
|
||||
cfg: params.cfg,
|
||||
megapixels: params.mode === 'generate' ? undefined : params.megapixels,
|
||||
turbo: params.turbo === true,
|
||||
strength: params.mode === 'refine' ? params.strength : undefined,
|
||||
strength: params.mode === 'generate' ? undefined : params.strength,
|
||||
width: params.mode === 'generate' ? params.width : undefined,
|
||||
height: params.mode === 'generate' ? params.height : undefined,
|
||||
seed: params.seed,
|
||||
|
||||
Reference in New Issue
Block a user