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:
@@ -27,7 +27,7 @@ import { readRecord, saveRecord, studio2Root, records } from './store';
|
||||
import { ensureComfyReady } from '../comfyLifecycle';
|
||||
import { comfyFetch, queuePrompt, fetchHistory, extractVideo, freeComfyVram } from '../comfy';
|
||||
import { extractEditedImage } from '../imageComfy';
|
||||
import { buildImageV2Workflow, resolveKreaGenerateAssets } from '../imageWorkflowV2';
|
||||
import { buildImageV2Workflow, resolveKreaGenerateAssets, resolveMossGenerateAssets } from '../imageWorkflowV2';
|
||||
import { resolveGraphLoraNames, applyUserLoraToGraph, ensureComfyLoraNames } from '../loras';
|
||||
import { getClip, getStill, stillPath, clipVideoPath, saveStill, saveClip, downloadComfyImage, downloadComfyVideo, attachStudio2Metadata } from '../library';
|
||||
import { imageDimensions } from '../resolution';
|
||||
@@ -315,6 +315,29 @@ async function prepareGraph(r: any) {
|
||||
r.graphId = 'studio2_minimax_native.json';
|
||||
}
|
||||
}
|
||||
else if (q.engine === 'moss') {
|
||||
if (q.mode !== 'generate')
|
||||
throw new Error('MOSS-Image is text-to-image only.');
|
||||
const moss = await resolveMossGenerateAssets();
|
||||
graph = buildImageV2Workflow({
|
||||
...s,
|
||||
engine: 'moss',
|
||||
mode: 'generate',
|
||||
task: 't2i',
|
||||
prompt: q.compiledPrompt,
|
||||
negative: stylePrompt(q.imageStyles, true),
|
||||
filenamePrefix: prefix + '/image',
|
||||
mossUnetName: moss.unet,
|
||||
mossClipName: moss.clip,
|
||||
mossVaeName: moss.vae,
|
||||
mossClipDevice: moss.clipDevice
|
||||
}).graph;
|
||||
applyResolvedImageSize(graph, s);
|
||||
r.sampleLatent = 'empty latent';
|
||||
r.sampleDenoise = null;
|
||||
r.heroReferenceAttached = false;
|
||||
r.graphId = 'moss_v2_generate.json';
|
||||
}
|
||||
else if (q.engine === 'qwen21') {
|
||||
if (!['generate', 'edit'].includes(q.mode))
|
||||
throw new Error('Qwen 2.1 supports Generate and Edit.')
|
||||
@@ -410,6 +433,8 @@ async function prepareGraph(r: any) {
|
||||
applyUserLoraToGraph(graph, s.loraStack)
|
||||
}
|
||||
else {
|
||||
if (q.engine === 'moss')
|
||||
throw new Error('MOSS-Image does not use the Klein or Krea graph.');
|
||||
const mode = identityPlan?.mode ?? (q.mode === 'iterate' ? (a ? 'edit' : 'generate') : q.mode);
|
||||
const found = q.engine === 'krea' ? await resolveKreaGenerateAssets() : null;
|
||||
const assets = found ? { kreaUnetName: found.unet, kreaClipName: found.clip, kreaVaeName: found.vae, kreaConceptLora: found.conceptLora } : {};
|
||||
|
||||
Reference in New Issue
Block a user