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.

Originals O4: a motion link opens on its Original, and a browser check of Fuobe DoP

Claude670487ddb1aa
diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsx
index 7f213ae1..8c4f2453 100644
--- a/src/components/studio/composer.tsx
+++ b/src/components/studio/composer.tsx
@@ -292,6 +292,17 @@ export function Composer({ docked }: { docked: boolean }) {
if (!m) return setDraft({ presetId: id });
setDraft((d) => ({ presetId: id, modelId: m.id, params: { ...m.defaults, numOutputs: d.params.numOutputs, enhancePrompt: d.params.enhancePrompt, seed: d.params.seed }, ...lookCleared(model, m) }));
};
+ // A motion handed over in the link (?preset= from the Motions gallery) is known once the presets load: it moves the
+ // studio's untouched default model to its Original, once per preset.
+ const adoptedPreset = useRef<string | undefined>(undefined);
+ useEffect(() => {
+ const want = presetModel(preset, engine);
+ if (!preset || !want || !model || adoptedPreset.current === preset.id) return;
+ adoptedPreset.current = preset.id;
+ if (model.id === want || model.id !== config.defaultModels[engine]) return;
+ const m = catalog.getModel(want);
+ if (m) setDraft((d) => (d.modelId !== model.id ? {} : { modelId: m.id, params: { ...m.defaults, numOutputs: d.params.numOutputs, enhancePrompt: d.params.enhancePrompt, seed: d.params.seed }, ...lookCleared(model, m) }));
+ }, [preset, engine, model, config.defaultModels, catalog, setDraft]);
// Single-purpose studios (Extend, Reframe, Edit video…) pin their operation.
const studioOp = config.ops.length === 1 && !preset ? config.ops[0] : undefined;
diff --git a/src/lib/catalog/index.ts b/src/lib/catalog/index.ts
index 819ae2ef..f2c89281 100644
--- a/src/lib/catalog/index.ts
+++ b/src/lib/catalog/index.ts
@@ -3,7 +3,7 @@ import { EFFECTS as RAW_EFFECTS, MOTIONS as RAW_MOTIONS } from "./motions";
import { MODELS } from "./models";
import { LLM_MODELS } from "./llm-models";
import { dopPreset, presetLoras } from "./dop";
-import { runsOn } from "./engines";
+import { onEngine, runsOn } from "./engines";
import { estimateCost } from "./plan";
import type { Engine, MediaKind, ModelDef, Operation, Preset } from "./types";
@@ -78,7 +78,8 @@ export function modelsFor(opts: { kind?: MediaKind; ops?: Operation[]; engine?:
!m.hidden &&
(!opts.kind || m.kind === opts.kind) &&
(!opts.engine || opts.engine === "all" || runsOn(m, opts.engine)) &&
- (!opts.ops || m.routes.some((r) => opts.ops!.includes(r.op))),
+ // An Original does on an engine what that engine's routes do (Fuobe DoP films keyframes on the GPU only).
+ (!opts.ops || (opts.engine && opts.engine !== "all" ? onEngine(m, opts.engine) : m).routes.some((r) => opts.ops!.includes(r.op))),
);
}
diff --git a/tests/e2e/dop-flows.mjs b/tests/e2e/dop-flows.mjs
new file mode 100644
index 00000000..1923491e
--- /dev/null
+++ b/tests/e2e/dop-flows.mjs
@@ -0,0 +1,148 @@
+// Fuobe DoP in the browser (build plan O4): a camera motion or effect picked in the Video studio runs on its Original,
+// the price says Free on the open engine and the hosted price in the cloud, a move whose cloud route is LTX-2.3's
+// camera LoRA follows the engine switch, a colour-grade effect's clip offers its grade, and Color grading opens with
+// it picked. Then the pages it changes fit a 390 px phone in light and dark mode.
+// Usage: node tests/e2e/dop-flows.mjs [appUrl] (the app runs in demo mode, no GPU; a fal key, any string, adds the
+// cloud price checks, and nothing is sent to fal)
+import fs from "node:fs";
+import path from "node:path";
+import { DESKTOP, launch, openRoute, PHONE, root } from "./_browser.mjs";
+
+const app = (process.argv[2] ?? "http://localhost:3000").replace(/\/$/, "");
+const results = [];
+const check = (name, ok, detail = "") => {
+ results.push({ name, ok });
+ console.log(`${ok ? "✓" : "✗"} ${name}${detail ? ` — ${detail}` : ""}`);
+};
+
+/** Upload the eval harness's start frame (a person on a bridge would do; this is its synthetic stand-in). */
+async function uploadStart() {
+ const data = fs.readFileSync(path.join(root, "scripts/eval/fixtures/start-frame.png"));
+ const form = new FormData();
+ form.append("file", new Blob([data], { type: "image/png" }), "start.png");
+ const res = await fetch(`${app}/api/uploads`, { method: "POST", body: form });
+ if (!res.ok) throw new Error(`upload failed: ${res.status}`);
+ return (await res.json()).url;
+}
+
+const start = await uploadStart();
+// Cloud prices show when a fal key is set (any key: nothing is sent to fal here); demo mode shows "Demo · free".
+const status = await (await fetch(`${app}/api/status`)).json().catch(() => ({}));
+const fal = !!status?.providers?.fal?.configured;
+if (!fal) console.log("note: no fal key on this server, so the cloud price checks are skipped (start it with FAL_KEY=anything to run them)");
+const browser = await launch();
+
+/** A page on an engine (the composer's switch is kept in localStorage). */
+async function studio(engine, query, opts = DESKTOP, scheme = "light") {
+ const ctx = await browser.newContext({ ...opts, colorScheme: scheme });
+ await ctx.addInitScript((e) => localStorage.setItem("fuobe.engine", e), engine);
+ const page = await ctx.newPage();
+ await openRoute(page, `${app}/video?${query}`, { settleMs: 1500 });
+ await page.waitForSelector("[data-composer]", { timeout: 30_000 });
+ return { page, ctx };
+}
+
+const composerText = (page) => page.locator("[data-composer]").innerText();
+
+// 1. A motion from the gallery lands on Fuobe DoP: free on the GPU, the LoRA endpoint's price in the cloud.
+{
+ const { page, ctx } = await studio("open", `preset=motion-overhead&image=${encodeURIComponent(start)}`);
+ await page.waitForFunction(() => /Fuobe DoP/.test(document.querySelector("[data-composer]")?.textContent ?? ""), null, { timeout: 20_000 }).catch(() => {});
+ const text = await composerText(page);
+ check("a motion opens on Fuobe DoP (open engine)", /Fuobe DoP/.test(text), text.replace(/\s+/g, " ").slice(0, 160));
+ check("its price on the open engine is free", /free/i.test(text), (text.match(/(Demo · )?[Ff]ree/) ?? ["no price"])[0]);
+ await page.screenshot({ path: "/tmp/claude-0/o-dop-shots/motion-open-1440.png" });
+ await ctx.close();
+}
+{
+ const { page, ctx } = await studio("cloud", `preset=motion-overhead&image=${encodeURIComponent(start)}`);
+ await page.waitForFunction((f) => (f ? /\$0\.50/ : /Fuobe DoP/).test(document.querySelector("[data-composer]")?.textContent ?? ""), fal, { timeout: 20_000 }).catch(() => {});
+ const text = await composerText(page);
+ check("in the cloud it runs on Fuobe DoP", /Fuobe DoP/.test(text), text.replace(/\s+/g, " ").slice(0, 160));
+ if (fal) check("in the cloud it shows the hosted price before the run ($0.10/s with LoRAs)", /\$0\.50/.test(text), (text.match(/\$\d+\.\d+/) ?? ["no price"])[0]);
+ await page.screenshot({ path: "/tmp/claude-0/o-dop-shots/motion-cloud-1440.png" });
+ await ctx.close();
+}
+
+// 2. Jib Up: Fuobe DoP on the GPU (the crane LoRA), Fuobe DoP · LTX in the cloud (LTX-2.3's jib camera LoRA).
+{
+ const { page, ctx } = await studio("cloud", `preset=motion-jib-up&image=${encodeURIComponent(start)}`);
+ await page.waitForFunction(() => /Fuobe DoP · LTX/.test(document.querySelector("[data-composer]")?.textContent ?? ""), null, { timeout: 20_000 }).catch(() => {});
+ check("a camera-LoRA move runs on Fuobe DoP · LTX in the cloud", /Fuobe DoP · LTX/.test(await composerText(page)));
+ await ctx.close();
+}
+
+// 3. A relight effect adds its relight step to the cloud price; a colour-grade effect's clip offers its grade.
+if (fal) {
+ // The clip carries no LoRA (the Relight LoRA is on the still): 5 s at $0.08/s, plus about $0.035 to relight the frame.
+ const { page, ctx } = await studio("cloud", `preset=effect-window&image=${encodeURIComponent(start)}`);
+ await page.waitForFunction(() => /\$0\.43/.test(document.querySelector("[data-composer]")?.textContent ?? ""), null, { timeout: 20_000 }).catch(() => {});
+ const text = await composerText(page);
+ check("a relight effect's price includes relighting the start frame ($0.40 + $0.035)", /\$0\.435?\b/.test(text), (text.match(/\$\d+\.\d+/) ?? ["no price"])[0]);
+ await ctx.close();
+}
+{
+ const res = await fetch(`${app}/api/generations`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ feature: "video", modelId: "fuobe-dop", presetId: "effect-candy-pink", prompt: "a woman on a bridge", inputs: { images: [start] }, engine: "open" }),
+ });
+ const made = res.ok ? await res.json() : null;
+ const id = made?.items?.[0]?.id;
+ // The demo provider finishes in a moment.
+ let done = null;
+ for (let i = 0; i < 60 && id; i++) {
+ const g = await (await fetch(`${app}/api/generations/${id}`)).json();
+ if (g.status === "succeeded") {
+ done = g;
+ break;
+ }
+ await new Promise((r) => setTimeout(r, 500));
+ }
+ check("a colour-grade effect's clip carries its grade", done?.outputs?.[0]?.meta?.grade === "candy-pink", JSON.stringify(done?.outputs?.[0]?.meta ?? {}));
+ const { page, ctx } = await studio("open", "");
+ const chip = page.getByRole("link", { name: "Apply the Candy Pink grade" }).first();
+ await chip.waitFor({ timeout: 20_000 }).catch(() => {});
+ check("the clip's first next step applies the grade", (await chip.count()) > 0);
+ if (await chip.count()) {
+ await chip.click();
+ await page.waitForURL(/\/color-grade\?/, { timeout: 20_000 });
+ await page.waitForTimeout(1500);
+ const pressed = await page.locator('[aria-pressed="true"]').allInnerTexts();
+ check("Color grading opens with the grade picked", pressed.some((t) => /Candy Pink/.test(t)), pressed.join(" | ").slice(0, 120));
+ await page.screenshot({ path: "/tmp/claude-0/o-dop-shots/grade-1440.png" });
+ }
+ await ctx.close();
+}
+
+// 4. The pages it changes fit a phone, light and dark.
+for (const scheme of ["light", "dark"]) {
+ for (const [engine, route] of [
+ ["open", `/video?preset=motion-overhead&image=${encodeURIComponent(start)}`],
+ ["cloud", `/video?preset=motion-jib-up&image=${encodeURIComponent(start)}`],
+ ["open", "/motions"],
+ ["open", "/effects"],
+ ["open", "/color-grade?preset=candy-pink"],
+ ]) {
+ const ctx = await browser.newContext({ ...PHONE, colorScheme: scheme });
+ await ctx.addInitScript((e) => localStorage.setItem("fuobe.engine", e), engine);
+ const page = await ctx.newPage();
+ await openRoute(page, app + route, { settleMs: 1200 });
+ // A dev server's first compile of a page can reload it once: measure again after the reload settles.
+ const measure = () => page.evaluate(() => ({ scroll: document.documentElement.scrollWidth, client: document.documentElement.clientWidth }));
+ const w = await measure().catch(async () => {
+ await page.waitForLoadState("load");
+ await page.waitForTimeout(1200);
+ return measure();
+ });
+ check(`${route.split("&")[0]} fits 390 px (${scheme})`, w.scroll <= w.client, `page ${w.scroll} px, window ${w.client} px`);
+ const name = `${route.replace(/[^a-z0-9]+/gi, "-").slice(1, 40)}-${scheme}-390.png`;
+ await page.screenshot({ path: `/tmp/claude-0/o-dop-shots/${name}` });
+ await ctx.close();
+ }
+}
+
+await browser.close();
+const failed = results.filter((r) => !r.ok);
+console.log(`\n${results.length - failed.length}/${results.length} checks passed`);
+process.exit(failed.length ? 1 : 0);