Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Merge branch 'r3fix/open-engine' into claude/fuobe-parity-3

Claude6cf9e513ff74
diff --cc src/lib/catalog/plan.ts
index 0e2ff7c4,876ce6a3..32e7eb4e
--- a/src/lib/catalog/plan.ts
+++ b/src/lib/catalog/plan.ts
@@@ -195,7 -182,10 +195,10 @@@ export function planGeneration
throw new Error(op === "tts" ? "Pick or record the voice to speak with" : "Pick or record the voice to change into");
}
if (op === "dub" && !req.inputs?.video && !req.inputs?.audio) throw new Error("Add the video to translate");
+ const requires = model.options.requires;
+ if (requires?.images && (req.inputs?.images?.length ?? 0) < requires.images) throw new Error(requires.msg);
+ if (requires?.prompt && !prompt) throw new Error(requires.msg);
- if (!prompt && !PROMPTLESS.has(op)) {
+ if (!prompt && !promptOptional(model, op)) {
throw new Error("Write a prompt first");
}
diff --cc src/lib/catalog/types.ts
index 0cd618c3,eafe5f54..d5dcf85a
--- a/src/lib/catalog/types.ts
+++ b/src/lib/catalog/types.ts
@@@ -297,17 -286,12 +297,23 @@@ export interface ModelOptions
sliders?: { param: string; label: string; min: number; max: number; step: number; default: number }[];
/** Extra enum settings sent as-is (Cinema Studio's genre, lens, light, grade, camera move…). */
controls?: { param: string; label: string; values: (string | number)[]; default?: string | number }[];
+ /** Images it needs before it can run (try-on: the person and the garment). */
+ minImages?: number;
+ /** What each image is, in order ("person photo", "garment"): blockers and slot labels. */
+ imageLabels?: string[];
+ /** None of its routes takes a prompt (try-on, 3D, transcription): the composer can hide the prompt box. */
+ promptless?: boolean;
+ /** Max reference videos / audio clips it accepts (reference-to-video: inputs.videos / inputs.audios). */
+ maxVideos?: number;
+ maxAudios?: number;
+ /** Spoken languages it can be told (transcription, captions): sent as params.sourceLanguage; unset = its default. */
+ sourceLanguages?: string[];
+ /**
+ * What this model needs beyond its operation's own inputs, checked before a job is created (the
+ * composer shows `msg` inline): reference images for a style-reference t2i model, a prompt for a
+ * model whose operation is otherwise promptless.
+ */
+ requires?: { images?: number; prompt?: boolean; msg: string };
}
export interface Pricing {
diff --cc tests/open-engine.test.ts
index f54baa82,884db98a..6f5459c8
--- a/tests/open-engine.test.ts
+++ b/tests/open-engine.test.ts
@@@ -138,6 -138,44 +138,44 @@@ describe("round-3 open models", () =>
expect(() => planGeneration({ feature: "captions", modelId: "oss-captions-burnin" }, getModel, getPreset)).toThrow(/video to caption/);
});
+ it("asks for a model's own inputs before a job exists (style references, a named element, media to transcribe)", () => {
+ const plan = (r: Record<string, unknown>) => () => planGeneration({ feature: "image", ...r } as Parameters<typeof planGeneration>[0], getModel, getPreset);
+ for (const id of ["oss-style-qwen-edit", "oss-style-flux2-klein", "oss-style-krea2", "oss-style-uso"]) {
+ expect(plan({ modelId: id, prompt: "a lighthouse at dawn" }), id).toThrow(/style reference|moodboard/);
+ expect(plan({ modelId: id, prompt: "a lighthouse at dawn", inputs: { images: ["/board.png"] } })().op).toBe("t2i");
+ }
+ expect(plan({ modelId: "oss-qwen-layered-control", inputs: { images: ["/a.png"] } })).toThrow("Name the element to pull out, e.g. “the guitar”");
+ expect(plan({ modelId: "oss-qwen-layered-control", prompt: "the guitar", inputs: { images: ["/a.png"] } })().op).toBe("layers");
+ expect(plan({ modelId: "oss-qwen-layered", inputs: { images: ["/a.png"] } })().op).toBe("layers"); // the plain split needs no prompt
- expect(plan({ modelId: "oss-qwen3-asr" })).toThrow("Add the video or audio to transcribe");
++ expect(plan({ modelId: "oss-qwen3-asr" })).toThrow("Add the audio or video to transcribe");
+ expect(plan({ modelId: "oss-qwen3-asr", inputs: { audio: "/a.wav" } })().op).toBe("transcribe");
- expect(plan({ modelId: "oss-voice-separate" })).toThrow("Add the video or audio to separate");
++ expect(plan({ modelId: "oss-voice-separate" })).toThrow("Add the audio or video to split");
+ expect(plan({ modelId: "oss-voice-separate", inputs: { video: "/v.mp4" } })().op).toBe("separate-audio");
+ expect(plan({ modelId: "oss-tryon-klein", prompt: "x", inputs: { images: ["/me.png"] } })).toThrow("Add a photo of the person, then the garment");
+ });
+
+ it("every open slider and control shows the value the workflow runs with when it is left alone", () => {
+ // Sliders and controls send params.extra only after a change, so their default must be the workflow's own.
+ const bound = (wid: string, key: string) => {
+ const t = workflowById.get(wid)?.bindings[key]?.[0];
+ if (!t) return undefined;
+ const graph = JSON.parse(fs.readFileSync(path.join(process.cwd(), "workflows/comfyui", workflowById.get(wid)!.file), "utf8"));
+ return graph[t.node]?.inputs[t.input];
+ };
+ const off: string[] = [];
+ for (const m of MODELS.filter((x) => x.engine === "open")) {
+ for (const r of m.routes.filter((x) => x.provider === "comfyui" && !x.endpoint.includes("{n}"))) {
+ const wf = workflowById.get(r.endpoint);
+ for (const c of [...(m.options.sliders ?? []), ...(m.options.controls ?? [])]) {
+ if (PROVIDER_PARAMS.has(c.param) || c.default === undefined || !wf?.bindings[c.param]) continue;
+ const runs = wf.defaults[c.param] ?? bound(r.endpoint, c.param);
+ if (runs !== undefined && String(runs) !== String(c.default)) off.push(`${m.id} ${c.param}: shows ${c.default}, runs ${runs}`);
+ }
+ }
+ }
+ expect(off).toEqual([]);
+ });
+
it("runs Virtual Try-On on the try-on LoRA on the open engine", () => {
const p = getPreset("app-virtual-try-on")!;
expect(p.open).toMatchObject({ modelId: "oss-tryon-klein", op: "edit" });