Add MOSS-Image on the Image v2 path and stop the queue calling it Klein.
The bench queue labeled every engine except Krea, Qwen, MiniMax, and LTX as Klein, and the v2 starter treated any engine other than Krea as Flux. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,8 +2,7 @@ import { addStudioJob, kickStudioQueue, listStudioJobs, videoJobsBusy } from '~/
|
||||
import { comfyConfigured } from '~/server/utils/comfy'
|
||||
import {
|
||||
IMAGE_V2_CFG_DEFAULT,
|
||||
IMAGE_V2_KREA_CFG,
|
||||
IMAGE_V2_KREA_STEPS,
|
||||
imageV2SamplingDefaults,
|
||||
IMAGE_V2_STEPS_DEFAULT,
|
||||
IMAGE_V2_TURBO_CFG,
|
||||
IMAGE_V2_TURBO_STEPS,
|
||||
@@ -54,12 +53,13 @@ export default defineEventHandler(async (event) => {
|
||||
const negative = buildAssetPackNegative(
|
||||
String(body?.negative_prompt ?? body?.negative ?? '').trim()
|
||||
)
|
||||
const turbo = parseBool(body?.turbo)
|
||||
const steps = engine === 'krea'
|
||||
? clampImageSteps(body?.steps, IMAGE_V2_KREA_STEPS)
|
||||
const turbo = engine === 'moss' ? false : parseBool(body?.turbo)
|
||||
const sampling = imageV2SamplingDefaults(engine)
|
||||
const steps = engine === 'krea' || engine === 'moss'
|
||||
? clampImageSteps(body?.steps, sampling.steps)
|
||||
: turbo ? IMAGE_V2_TURBO_STEPS : clampImageSteps(body?.steps, IMAGE_V2_STEPS_DEFAULT)
|
||||
const cfg = engine === 'krea'
|
||||
? clampImageCfg(body?.cfg, IMAGE_V2_KREA_CFG)
|
||||
const cfg = engine === 'krea' || engine === 'moss'
|
||||
? clampImageCfg(body?.cfg, sampling.cfg)
|
||||
: turbo ? IMAGE_V2_TURBO_CFG : clampImageCfg(body?.cfg, IMAGE_V2_CFG_DEFAULT)
|
||||
const seed = body?.seed != null && String(body.seed) !== '' && String(body.seed) !== 'random'
|
||||
? Number(body.seed)
|
||||
|
||||
@@ -44,7 +44,7 @@ export default defineEventHandler(async (event) => {
|
||||
// Enqueue + kick after the client has the id — do not block the response on the worker wake path
|
||||
void (async () => {
|
||||
try {
|
||||
const row = await addStudioJob({ ownerKey: owner, kind: ['video', 'extend'].includes(request.mode) ? 'video' : 'edit', familyId: record.familyId, payload: { ...request.settings, studio2Id: id, studio2Request: structuredClone(request), prompt: request.compiledPrompt, folderId: request.folderId, extensions: [], referenceStillIds: [], useIdentityRefs: false, queueAutoRun: true } as StudioJobPayload });
|
||||
const row = await addStudioJob({ ownerKey: owner, kind: ['video', 'extend'].includes(request.mode) ? 'video' : 'edit', familyId: record.familyId, payload: { ...request.settings, engine: request.engine, studio2Id: id, studio2Request: structuredClone(request), prompt: request.compiledPrompt, folderId: request.folderId, extensions: [], referenceStillIds: [], useIdentityRefs: false, queueAutoRun: true } as StudioJobPayload });
|
||||
saveRecord({ ...readRecord(owner, id), queueId: row.id });
|
||||
} catch { /* poll / resume will pick up waiting studio2 records */ }
|
||||
kickStudioQueue();
|
||||
|
||||
@@ -15,6 +15,8 @@ import {
|
||||
IMAGE_V2_KREA_COMPOSE_DENOISE,
|
||||
IMAGE_V2_KREA_EDIT_DENOISE,
|
||||
IMAGE_V2_KREA_STEPS,
|
||||
IMAGE_V2_MOSS_CFG,
|
||||
IMAGE_V2_MOSS_STEPS,
|
||||
IMAGE_V2_DENOISE_DEFAULT,
|
||||
clampImageV2Denoise,
|
||||
clampImageV2Size,
|
||||
@@ -226,13 +228,23 @@ export default defineEventHandler(async (event) => {
|
||||
const hideThumbnail = parseBool(fields.hideThumbnail)
|
||||
const requestedEngine = parseImageV2Engine(fields.engine, 'flux')
|
||||
const engine = requestedEngine
|
||||
const turbo = parseBool(fields.turbo)
|
||||
if (engine === 'moss' && graphMode !== 'generate') {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: 'MOSS-Image is text-to-image only. Use Generate, or Klein or Krea for edits.'
|
||||
})
|
||||
}
|
||||
const turbo = engine === 'moss' ? false : parseBool(fields.turbo)
|
||||
const steps = engine === 'krea'
|
||||
? clampImageSteps(fields.steps, IMAGE_V2_KREA_STEPS)
|
||||
: turbo ? IMAGE_V2_TURBO_STEPS : clampImageSteps(fields.steps, IMAGE_V2_STEPS_DEFAULT)
|
||||
: engine === 'moss'
|
||||
? clampImageSteps(fields.steps, IMAGE_V2_MOSS_STEPS)
|
||||
: turbo ? IMAGE_V2_TURBO_STEPS : clampImageSteps(fields.steps, IMAGE_V2_STEPS_DEFAULT)
|
||||
const cfg = engine === 'krea'
|
||||
? clampImageCfg(fields.cfg, IMAGE_V2_KREA_CFG)
|
||||
: turbo ? IMAGE_V2_TURBO_CFG : clampImageCfg(fields.cfg, IMAGE_V2_CFG_DEFAULT)
|
||||
: engine === 'moss'
|
||||
? clampImageCfg(fields.cfg, IMAGE_V2_MOSS_CFG)
|
||||
: turbo ? IMAGE_V2_TURBO_CFG : clampImageCfg(fields.cfg, IMAGE_V2_CFG_DEFAULT)
|
||||
const megapixels = graphMode === 'generate'
|
||||
? 0
|
||||
: fields.scaleToTotalPixels == null
|
||||
|
||||
Reference in New Issue
Block a user