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.

Connect: the swap and removal rows say they run on the full MiniMax H3 only when the card is too small for them, and a browser check of the H3 tiers

Claudea858f40f54b9
diff --git a/src/lib/gpu/h3-tier.ts b/src/lib/gpu/h3-tier.ts
index 10b7b491..8b76dfe4 100644
--- a/src/lib/gpu/h3-tier.ts
+++ b/src/lib/gpu/h3-tier.ts
@@ -306,16 +306,18 @@ export function tierOnCard(
export const REF2VA_H3 = /^video-(character-swap-h3|person-remove-h3)/;
/** What the pre-flight board says next to a row (src/server/gpu/readiness-service.ts): the build this card runs, or why none. */
-export function tierRowNote(workflows: string[], choice: H3TierChoice | undefined, inv: GpuInventory): { label: string; note?: string } | undefined {
+export function tierRowNote(workflows: string[], choice: H3TierChoice | undefined, inv: GpuInventory, idx: RequirementIndex): { label: string; note?: string } | undefined {
if (choice && choice.tier !== "standard") {
const textOnly = choice.tier === "trim" ? "text to video only" : undefined;
const offload = choice.offload ? "part of it waits in system memory" : undefined;
const note = [textOnly, offload].filter(Boolean).join("; ");
return { label: choice.label, ...(note && { note: note[0].toUpperCase() + note.slice(1) }) };
}
+ // A card too small for the reference graphs (the GPU check's own reading, as their "Needs … GB" line says it).
const gb = gpuVramGb(inv);
- if (typeof gb === "number" && gb < H3_STANDARD_GB && workflows.some((w) => REF2VA_H3.test(w))) {
- return { label: "Standard", note: "Needs the full MiniMax H3 (32 GB): there's no smaller build for swaps and removals yet" };
+ const need = Math.max(0, ...workflows.filter((w) => REF2VA_H3.test(w)).map((w) => idx.workflows[w]?.vramGb ?? 0));
+ if (typeof gb === "number" && need > 0 && gb < need) {
+ return { label: "Standard", note: "Runs on the full MiniMax H3: there's no smaller build for swaps and removals yet" };
}
return undefined;
}
diff --git a/src/server/gpu/readiness-service.ts b/src/server/gpu/readiness-service.ts
index 09b8d20f..4b4700d3 100644
--- a/src/server/gpu/readiness-service.ts
+++ b/src/server/gpu/readiness-service.ts
@@ -55,7 +55,7 @@ export function buildViews(inv: GpuInventory, idx: RequirementIndex, ctx: Readin
.filter((o) => o.state === "ready" || o.state === "almost")
.sort((a, b) => rankOf(b.state) - rankOf(a.state))
.slice(0, 4);
- const tier = tierRowNote(tool.workflows, onCard(tool, inv, idx).choice, inv);
+ const tier = tierRowNote(tool.workflows, onCard(tool, inv, idx).choice, inv, idx);
studios.push({ href: row.href, label: row.label, group: row.group, tool: { ...t, needs: t.needs.slice(0, 12), have: [] }, others, ...(tier && { gpuTier: tier }) });
}
const badges: BadgeMap = { connected: true, checkedAt: inv.checkedAt, models: {}, presets: {} };
diff --git a/tests/e2e/h3-any-gpu.mjs b/tests/e2e/h3-any-gpu.mjs
new file mode 100644
index 00000000..b5b5851a
--- /dev/null
+++ b/tests/e2e/h3-any-gpu.mjs
@@ -0,0 +1,211 @@
+// nm10-h3-any-gpu in the browser (no run reaches a GPU): MiniMax H3's Options in the Video studio on your GPU (GPU tier with
+// Auto, 32 GB, FastH3 V2 and Trim; Decoder with Fast decode), the composer's note for a picked tier and for Auto on the card the
+// last GPU check read, and the Connect board's Video row naming the build that card gets. Each at 1440 and 390 px, light and
+// dark, without sideways scroll, failing on console errors.
+// Usage: FUOBE_DATA_DIR=<the dev server's data dir> node tests/e2e/h3-any-gpu.mjs [appUrl] [--shots <dir>] (on a dev server started fresh,
+// with an empty data dir)
+// The dev server runs with COMFYUI_URL=http://comfy.test:8188 (unreachable). The script writes the install's last GPU check
+// into the server's database (a 12 GB RTX 4070, the Trim files present) before any page reads it. Generate is never pressed.
+import crypto from "node:crypto";
+import fs from "node:fs";
+import path from "node:path";
+import { createRequire } from "node:module";
+import { launch, root } from "./_browser.mjs";
+
+const argv = process.argv.slice(2);
+const app = (argv.find((a) => !a.startsWith("--") && argv[argv.indexOf(a) - 1] !== "--shots") ?? "http://localhost:3000").replace(/\/$/, "");
+const shots = argv.includes("--shots") ? argv[argv.indexOf("--shots") + 1] : undefined;
+if (shots) fs.mkdirSync(shots, { recursive: true });
+const dataDir = process.env.FUOBE_DATA_DIR;
+if (!dataDir) throw new Error("Set FUOBE_DATA_DIR to the dev server's data dir");
+const comfyUrl = (process.env.COMFYUI_URL ?? "http://comfy.test:8188").replace(/\/+$/, "");
+
+const failures = [];
+const check = (label, ok, extra = "") => {
+ console.log(`${ok ? "ok " : "FAIL"} ${label.padEnd(84)}${extra ? ` ${extra}` : ""}`);
+ if (!ok) failures.push(label);
+};
+const flat = (s) => String(s ?? "").replace(/\s+/g, " ").trim();
+
+// ---- The install's last GPU check: a 12 GB RTX 4070 on a CUDA 12.8 PyTorch with FastH3 Trim's fp8 file and the shared files.
+async function seed() {
+ // The server creates its database on its first request.
+ await fetch(`${app}/api/status`).catch(() => null);
+ const Database = createRequire(path.join(root, "package.json"))("better-sqlite3");
+ const db = new Database(path.join(dataDir, "fuobe.db"));
+ const index = JSON.parse(fs.readFileSync(path.join(root, "workflows/comfyui/requirements.json"), "utf8"));
+ const files = ["diffusion_models/fastvideo_fasth3_trim_8step_fp8.safetensors", ...index.workflows["minimax-h3-trim-t2v"].files.filter((f) => !f.startsWith("diffusion_models/"))];
+ const models = {};
+ for (const folder of index.folders) models[folder] = { have: {}, total: 0 };
+ for (const key of files) {
+ const [folder, file] = key.split("/");
+ models[folder].have[file] = index.files[key].sizeBytes;
+ models[folder].total++;
+ }
+ const at = Date.now();
+ const inventory = {
+ v: 1, via: "server", checkedAt: at, tookMs: 5, reachable: true,
+ comfy: { version: "0.43.0", os: "posix", torch: "2.9.1+cu128", embeddedPython: false, deployEnv: "local-git", flags: { cpuOnly: false } },
+ devices: [{ name: "cuda:0 NVIDIA GeForce RTX 4070 : cudaMallocAsync", type: "cuda", index: 0, vramTotal: 12 * 2 ** 30, vramFree: 11 * 2 ** 30 }],
+ ram: { total: 64 * 2 ** 30, free: 48 * 2 ** 30 },
+ manager: { api: "none" },
+ nodes: { have: [], missing: [], total: 1700, readAt: at, how: "object_info" },
+ combos: {}, packs: {}, models, loras: {}, fingerprint: "e2e", errors: [],
+ };
+ const urlHash = crypto.createHash("sha256").update(`${comfyUrl.toLowerCase()}|server`).digest("hex");
+ db.prepare(
+ `INSERT INTO gpu_snapshots (target_key, via, url_hash, checked_at, index_hash, inventory_json, report_json, stale) VALUES ('install', 'server', ?, ?, ?, ?, NULL, 0)
+ ON CONFLICT(target_key, via) DO UPDATE SET url_hash = excluded.url_hash, checked_at = excluded.checked_at, index_hash = excluded.index_hash, inventory_json = excluded.inventory_json, report_json = NULL, stale = 0`,
+ ).run(urlHash, at, index.hash, JSON.stringify(inventory));
+ db.close();
+}
+
+const browser = await launch();
+const errors = [];
+const contextFor = async (engine, width = 1440, colorScheme = "light") => {
+ const context = await browser.newContext({ viewport: { width, height: width < 500 ? 844 : 900 }, colorScheme, ...(width < 500 && { isMobile: true, hasTouch: true }) });
+ await context.addInitScript((e) => {
+ try {
+ localStorage.setItem("fuobe.engine", e);
+ } catch {}
+ }, engine);
+ const page = await context.newPage();
+ page.setDefaultTimeout(60_000);
+ page.on("console", (m) => {
+ if (m.type() === "error") errors.push(`${width} ${colorScheme}: ${m.text().slice(0, 200)}`);
+ });
+ page.on("pageerror", (e) => errors.push(`${width} ${colorScheme}: ${String(e).slice(0, 200)}`));
+ return { context, page };
+};
+const composer = (page) => page.locator("[data-composer]").first();
+const shoot = (page, name) => (shots ? page.screenshot({ path: path.join(shots, name), fullPage: false }) : undefined);
+const noSideways = (page) => page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1);
+const openMenu = async (page) => {
+ const button = page.locator('button[aria-label^="Model: "][aria-label$="Change model"]:visible').first();
+ const search = page.getByPlaceholder(/^Search( (all )?models)?/);
+ for (let i = 0; i < 3; i++) {
+ await button.waitFor({ state: "visible", timeout: 60_000 });
+ await button.focus();
+ await page.keyboard.press("Enter");
+ if (await search.waitFor({ timeout: 10_000 }).then(() => true, () => false)) return search;
+ }
+ await search.waitFor();
+ return search;
+};
+const pick = async (page, query, id) => {
+ const search = page.getByPlaceholder(/^Search( (all )?models)?/);
+ await search.fill(query);
+ const row = page.locator(`[cmdk-item][data-value$=":${id}"]`).first();
+ await row.waitFor({ timeout: 15_000 });
+ let picked = false;
+ for (let i = 0; i < 12 && !picked; i++) {
+ picked = (await row.getAttribute("data-selected")) === "true";
+ if (!picked) await page.keyboard.press("ArrowDown");
+ }
+ await page.keyboard.press("Enter");
+ await page.waitForTimeout(900);
+};
+/** Opens the chip that holds MiniMax H3's settings (the Video studio names it Director; on a phone it can sit in Settings). */
+const openOptions = async (page) => {
+ const chip = composer(page).getByRole("button", { name: /^(Director|Options)/ }).first();
+ if (!(await chip.isVisible().catch(() => false))) {
+ const settings = composer(page).getByRole("button", { name: /^Settings:/ }).first();
+ await settings.focus();
+ await page.keyboard.press("Enter");
+ const sheet = page.getByRole("dialog").first();
+ await sheet.waitFor({ timeout: 10_000 });
+ const inner = sheet.getByRole("button", { name: /^(Director|Options)/ }).first();
+ await inner.focus();
+ await page.keyboard.press("Enter");
+ return;
+ }
+ await chip.focus();
+ await page.keyboard.press("Enter");
+};
+const listOf = async (page, box) => {
+ await box.focus();
+ await page.keyboard.press("Enter");
+ const list = page.getByRole("listbox").last();
+ await list.waitFor({ timeout: 10_000 });
+ const items = (await list.getByRole("option").allInnerTexts()).map(flat);
+ await page.keyboard.press("Escape");
+ return items;
+};
+
+if (argv.includes("--seed-only")) {
+ await seed();
+ process.exit(0);
+}
+try {
+ await seed();
+ // The Connect page starts a fresh check of the (unreachable) address once the last one is a minute old, and the server keeps
+ // the check it read in memory: its four visits come first, within that minute of the seed, on a server started fresh.
+ for (const width of [1440, 390]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${width} ${scheme}`;
+ // ---- Connect your GPU: the Video row names the build this card gets.
+ {
+ const { context, page } = await contextFor("open", width, scheme);
+ await page.goto(`${app}/connect`, { waitUntil: "load" });
+ const line = page.getByText(/(Ready on|On) this GPU:/).first();
+ await line.waitFor({ timeout: 60_000 }).catch(() => {});
+ const row = page.locator("li").filter({ has: page.getByText("Video", { exact: true }) }).filter({ hasText: /this GPU:/ }).first();
+ const text = flat(await row.innerText().catch(() => ""));
+ check(`${tag} connect: the Video row reads Ready on this GPU: FastH3 Trim (fp8)`, /Ready on this GPU: FastH3 Trim \(fp8\)/.test(text), text.slice(0, 160));
+ check(`${tag} connect: it says text to video only`, /Text to video only/.test(text));
+ const swap = flat(await page.locator("li").filter({ has: page.getByText("Character swap", { exact: true }) }).first().innerText().catch(() => ""));
+ check(`${tag} connect: Character swap says it needs the full model`, /Runs on the full MiniMax H3/.test(swap), swap.slice(0, 160));
+ if (width < 500) await row.scrollIntoViewIfNeeded().catch(() => {});
+ await shoot(page, `connect-${width}-${scheme}.png`);
+ check(`${tag} connect: nothing scrolls sideways`, await noSideways(page));
+ await context.close();
+ }
+ }
+ }
+ for (const width of [1440, 390]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${width} ${scheme}`;
+ // ---- Video studio on your GPU: MiniMax H3's GPU tier and Decoder, and the composer's note.
+ {
+ const { context, page } = await contextFor("open", width, scheme);
+ await page.goto(`${app}/video`, { waitUntil: "load" });
+ await composer(page).waitFor({ timeout: 60_000 });
+ await page.waitForTimeout(1200);
+ await openMenu(page);
+ await pick(page, "MiniMax H3", "oss-minimax-h3");
+ await composer(page).getByRole("textbox").first().fill("A lighthouse at dusk, waves on the rocks, gulls calling");
+ await page.waitForTimeout(800);
+ await page.getByText(/On your GPU this runs as/).first().waitFor({ timeout: 15_000 }).catch(() => {});
+ // Auto on the 12 GB card the check read: Trim, said in plain words.
+ const auto = page.getByText(/On your GPU this runs as FastH3 Trim/);
+ check(`${tag} video: Auto on a 12 GB card says it runs as FastH3 Trim`, (await auto.count()) > 0);
+ await openOptions(page);
+ const tier = page.getByRole("combobox", { name: "GPU tier" });
+ await tier.waitFor({ timeout: 10_000 });
+ const tiers = await listOf(page, tier);
+ check(`${tag} video: GPU tier offers Auto, 32 GB, FastH3 V2 and Trim`, tiers[0] === "Auto" && tiers.some((t) => /FastH3 V2/.test(t)) && tiers.some((t) => /FastH3 Trim, experimental, text to video only/.test(t)), tiers.join(" | "));
+ const decoder = page.getByRole("combobox", { name: "Decoder" });
+ check(`${tag} video: Decoder starts on Standard`, /Standard/.test(flat(await decoder.innerText())), flat(await decoder.innerText()));
+ const decoders = await listOf(page, decoder);
+ check(`${tag} video: Decoder offers Fast decode for 32 GB GPUs`, decoders.includes("Fast decode · 32 GB GPU"), decoders.join(" | "));
+ // FastH3 V2 picked: the composer says what it changes.
+ await tier.focus();
+ await page.keyboard.press("Enter");
+ await page.getByRole("listbox").last().getByRole("option", { name: /FastH3 V2/ }).click();
+ await page.waitForTimeout(400);
+ check(`${tag} video: FastH3 V2 picked, the composer says what it changes`, (await page.getByText(/^FastH3 V2: an 8-step build of MiniMax H3/).count()) > 0);
+ await shoot(page, `video-${width}-${scheme}.png`);
+ check(`${tag} video: nothing scrolls sideways`, await noSideways(page));
+ await context.close();
+ }
+ }
+ }
+ check("no console errors", errors.length === 0, errors.slice(0, 5).join(" || "));
+} finally {
+ await browser.close();
+}
+if (failures.length) {
+ console.log(`\n${failures.length} failed`);
+ process.exit(1);
+}
+console.log("\nall passed");
diff --git a/tests/h3-any-gpu.test.ts b/tests/h3-any-gpu.test.ts
index d633df70..aae86bac 100644
--- a/tests/h3-any-gpu.test.ts
+++ b/tests/h3-any-gpu.test.ts
@@ -291,7 +291,7 @@ describe("the pre-flight board", () => {
it("says plainly that swaps and removals still need the full model", () => {
const swap = row("/character-swap", inventory({ gb: 16, name: RTX4070 }));
- expect(swap.gpuTier?.note).toMatch(/Needs the full MiniMax H3 \(32 GB\)/);
+ expect(swap.gpuTier?.note).toMatch(/Runs on the full MiniMax H3: there's no smaller build for swaps and removals yet/);
expect(row("/character-swap", inventory({ gb: 48, name: RTX4090 })).gpuTier).toBeUndefined();
// The Video row's own tool is the full model's three modes (the board swaps them per card).
expect(studioTool(STUDIO_ROWS.find((r) => r.href === "/video")!)!.workflows).toEqual(expect.arrayContaining(["minimax-h3-t2v", "minimax-h3-i2v", "minimax-h3-flf2v"]));