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.

Own setup: Restore & colourise says it runs on your own GPU, and Remove a person and VOID wait for a real render

Adarsh9a29b5172971
diff --git a/docs/public-signup.md b/docs/public-signup.md
index 47d1d280..0df28b6b 100644
--- a/docs/public-signup.md
+++ b/docs/public-signup.md
@@ -279,9 +279,11 @@ cloudflared tunnel --url http://localhost:8188 # or: ngrok http 8188
(Canvas, Assist, Marketing…) answer 403 with `code: "own-gpu-tool"`, because they
plan with the studio's own AI helpers or keep projects of their own. The Audio tools have their own routes (below).
Restore & colourise (`POST /api/restore`) shows to everyone, its tab, page and result-menu item marked "Runs on your
- own GPU · 24 GB or fal.ai key": an account runs it on its own GPU or fal.ai key after the same checks as Genjutsu's,
- with Fuobe's offline template for the words (writing them from the frames with the studio's AI helper stays the
- owner's); a guest gets the sign-up card, an account with neither "Connect your GPU". A guest's model pickers list the
+ own GPU · 24 GB": an account runs it on its own GPU after the same checks as Genjutsu's, with Fuobe's offline template
+ for the words (writing them from the frames with the studio's AI helper stays the owner's). A visitor's page is the
+ GPU's whatever the engine switch says, since the cloud engine carries the gated Restore IC-LoRA, which never goes with
+ an account's own key (an account's cloud run answers 422 before anything starts); a guest gets the sign-up card, an
+ account without a GPU "Connect your GPU". A guest's model pickers list the
paid models after the open ones, each marked "Use your own fal.ai key" (or Replicate); choosing one opens the sign-up
card. An account without a key sees the same list with "Add your fal.ai key". Image to 3D's cloud models, Retexture,
Rig and "Use the cloud" for Pick an object are marked the same way for a visitor on open models only.
@@ -400,7 +402,10 @@ cloudflared tunnel --url http://localhost:8188 # or: ngrok http 8188
AI helper. Turnaround and Fly around never use the studio's WorldCast worker for an account; a character from the
owner's library answers 404. Katana's runs are its own projects (`GET /api/katana`, `GET`/`DELETE
/api/katana/<id>`): up to 50, another account's or the owner's read as 404, deleted with the account. A guest gets
- the sign-up card.
+ the sign-up card. Removing a person with MiniMax H3 and VOID's removal on the open engine keep their "own setup"
+ entries (`video-tools:remove-person`, `video-tools:remove-object-void` in `src/lib/own-setup.ts`) until a real render
+ passes on this studio's GPU and is recorded in `workflows/comfyui/gpu-tested.json` (`remove-person`,
+ `remove-object-void`): their graphs' `validated` in the manifest says only that ComfyUI accepted the graph.
- **Audio tools.** An account runs Split soundtrack and Clean up dialogue, Video tools → Remove dialogue, Edit speech,
Loop / extend, Join and Clean up voice (`POST /api/audio-tools`) the same way as Genjutsu's: every step on its own
ComfyUI, or on its own fal.ai or Replicate key where a step is a cloud model, with only its own files, after the same
diff --git a/src/app/api/restore/route.ts b/src/app/api/restore/route.ts
index 0c7f0966..3beea0f7 100644
--- a/src/app/api/restore/route.ts
+++ b/src/app/api/restore/route.ts
@@ -4,9 +4,9 @@ import { body, handle, once } from "@/server/shorts-schemas";
/**
* Restore & colourise a clip (Fuobe Restore): the prompt is written first when none is given; windows or pieces are
- * joined and the sound put back. The owner's run as always; an account's on its own GPU or its own fal.ai key, with its
- * own files and Fuobe's offline template for the words, after the checks every tool run gets
- * (src/server/account-tool-run.ts); a guest signs up first.
+ * joined and the sound put back. The owner's run as always; an account's on its own GPU (its cloud run is refused: the
+ * gated Restore IC-LoRA never goes with its key), with its own files and Fuobe's offline template for the words, after
+ * the checks every tool run gets (src/server/account-tool-run.ts); a guest signs up first.
*/
export async function POST(request: Request) {
const viewer = toolViewer(request);
diff --git a/src/components/restore/restore-tool.tsx b/src/components/restore/restore-tool.tsx
index 15776f14..caf5ebd9 100644
--- a/src/components/restore/restore-tool.tsx
+++ b/src/components/restore/restore-tool.tsx
@@ -20,6 +20,7 @@ import { OwnSetupChip, useOwnSetupPress } from "@/components/own-setup";
import type { OwnSetup } from "@/lib/own-setup";
import { useEngine, useGenerations, useLikelyVisitor } from "@/lib/api";
import { CLOUD_NOTE, GPU_NOTE, offlineRestorePrompt, RESTORE, RESTORE_UPSCALE, restoreNegative } from "@/lib/catalog/restore";
+import type { Engine } from "@/lib/catalog/types";
import { THEN_UPSCALE } from "@/lib/catalog/upscale-first";
import { chainState } from "@/lib/catalog/shorts";
import { downloadHref, downloadName } from "@/lib/library";
@@ -48,11 +49,13 @@ interface Run {
export function RestoreTool({ setup }: { setup?: OwnSetup | null } = {}) {
// What the page read for "video-tools:restore" (ownSetupsNow): null once its graph is validated, when the label leaves.
const item = setup === undefined ? "video-tools:restore" : setup;
- const [engine] = useEngine();
- // Guests and accounts: it runs on the visitor's own GPU or fal.ai key (own-setup.ts "video-tools:restore"). A guest
- // signs up first, an account without either connects one; the words come from Fuobe's template (the studio's AI
- // helper is the owner's).
+ // Guests and accounts: it runs on the visitor's own GPU (own-setup.ts "video-tools:restore"), so their page is the
+ // GPU's whatever the engine switch says: the cloud engine carries the gated Restore IC-LoRA, which never goes with a
+ // visitor's own key. A guest signs up first, an account without a GPU connects one; the words come from Fuobe's
+ // template (the studio's AI helper is the owner's).
const visitor = useLikelyVisitor();
+ const [chosen] = useEngine();
+ const engine: Engine = visitor ? "open" : chosen;
const press = useOwnSetupPress();
const source = useSourceClip(RESTORE.maxBytes);
const clip = source.clip;
@@ -312,7 +315,7 @@ export function RestoreTool({ setup }: { setup?: OwnSetup | null } = {}) {
) : (
<>
<p className="flex items-center gap-1.5 text-[15px] font-semibold tabular-nums">
- {costText(est, engine, visitor)}
+ {costText(est, engine)}
{estimate.isFetching && <Loader2 className="size-3 animate-spin text-muted-foreground" aria-label="Updating the price" />}
</p>
{est && (
diff --git a/src/components/shorts/ui.tsx b/src/components/shorts/ui.tsx
index f8700cb7..5f0e2377 100644
--- a/src/components/shorts/ui.tsx
+++ b/src/components/shorts/ui.tsx
@@ -237,13 +237,9 @@ export function Steps({ steps, current, className }: { steps: string[]; current:
);
}
-/**
- * "≈ $0.42", "Placeholder · free", "Free · your GPU". visitor: a guest or an account, whose GPU these tools don't run on yet
- * (the page says why): "Not available here", a demo's price too, since its button is off.
- */
-export function costText(e: { costUsd: number | null; demo: boolean } | undefined, engine: "cloud" | "open", visitor?: boolean): string {
+/** "≈ $0.42", "Placeholder · free", "Free · your GPU". A visitor's price is never a demo (src/server/visitor.ts priceAs). */
+export function costText(e: { costUsd: number | null; demo: boolean } | undefined, engine: "cloud" | "open"): string {
if (!e) return "…";
- if (visitor && (e.demo || engine === "open")) return "Not available here";
if (e.demo) return "Placeholder · free";
if (engine === "open") return "Free · your GPU";
if (e.costUsd === null) return "Price unknown";
diff --git a/src/lib/own-setup.ts b/src/lib/own-setup.ts
index 6649d964..142560bc 100644
--- a/src/lib/own-setup.ts
+++ b/src/lib/own-setup.ts
@@ -93,11 +93,15 @@ const ITEMS: Record<string, Entry> = {
"image-to-3d:idol-clean": { setup: gpu(8, { files: true }), graphs: ["image-to-splat-idol-clean"] },
// Tools whose steps run on a GPU of the visitor's own.
"audio:edit-speech": { setup: gpu(24, { files: true }), graphs: ["speech-edit-auk"] },
- "video-tools:restore": { setup: gpu(24, { files: true, orKey: "fal" }), graphs: ["video-restore-ltx25-tiled"] },
- // Validated on this studio's GPU already (their graphs): no label shows once a surface reads ownSetupsNow, and none
- // asks for them on the client.
- "video-tools:remove-person": { setup: gpu(24), graphs: ["video-person-remove-h3-relay", "video-person-remove-h3-mask"] },
- "video-tools:remove-object-void": { setup: gpu(40), graphs: ["video-erase-void"] },
+ // On the visitor's own GPU only: the cloud engine carries the gated Restore IC-LoRA, which never goes with a visitor's
+ // own key (src/server/loras.ts prepareCloudLoras), so an account's cloud run is refused before it starts.
+ "video-tools:restore": { setup: gpu(24, { files: true }), graphs: ["video-restore-ltx25-tiled"] },
+ // Removing a person with H3 and VOID's removal open on this studio's GPU once a real render passes there (`passes`).
+ // Their graphs' manifest `validated` only says ComfyUI accepted the graph (scripts/comfy/validate-workflows.mjs
+ // queues it with placeholder model files and takes it back before it runs): VOID's two passes and the H3 removal
+ // have never rendered on this studio's GPU, so that flag can't lift their label.
+ "video-tools:remove-person": { setup: gpu(24), passes: "remove-person" },
+ "video-tools:remove-object-void": { setup: gpu(40), passes: "remove-object-void" },
"cinema:world": { setup: gpu(24, { files: true }) },
"oss-hy-nomas-world": { setup: gpu(24, { files: true }) },
};
diff --git a/src/server/restore.ts b/src/server/restore.ts
index 3e78fc12..ef2a31f2 100644
--- a/src/server/restore.ts
+++ b/src/server/restore.ts
@@ -42,6 +42,9 @@ import { tenant } from "./tenant";
export { ShortsError as RestoreError };
+/** An account's answer to a cloud run: it restores on its own GPU (its page runs there already). */
+export const RESTORE_ON_YOUR_GPU = "Restore this clip on your own GPU: switch to open source.";
+
const fileUrl = z.string().startsWith("/api/files/").max(500);
const source = z.object({
@@ -284,6 +287,10 @@ export interface RestoreRun {
export async function planRestoreRun(body: z.infer<typeof RestoreBodySchema>): Promise<RestoreRun> {
mustMatchMode(body.engine);
mustBeOffered(body.engine);
+ // An account restores on its own GPU only (own-setup.ts "video-tools:restore"): the cloud carries the gated Restore
+ // IC-LoRA, which never goes with an account's own key (src/server/loras.ts prepareCloudLoras), so its cloud run would
+ // only fail at submit, whatever copy or token the install holds.
+ if (body.engine === "cloud" && tenant()) throw new ShortsError(RESTORE_ON_YOUR_GPU, 422);
const info = await probeSource(body.source.url);
let prompt = body.prompt?.trim() ?? "";
let negative = body.negative?.trim() ?? "";
@@ -302,7 +309,6 @@ export async function planRestoreRun(body: z.infer<typeof RestoreBodySchema>): P
// a copy to send (a live one on fal, or the file on this machine), every piece would fail at submit, so the run is
// refused before anything starts (a placeholder run needs no file).
if (body.engine === "cloud" && !gatedReady("cloud") && !price(plan.steps).demo) {
- if (tenant()) throw new ShortsError("Restore this clip on your own GPU: switch to open source.", 422);
throw new ShortsError(`${gatedHint("Lightricks' Restore IC-LoRA", RESTORE.loras.restore.page)}. A cloud run gets Fuobe's copy of the file, never your token`, 422);
}
return { steps: plan.steps, final: plan.final, prompt, negative: input.negative, by };
diff --git a/tests/account-video-tools.test.ts b/tests/account-video-tools.test.ts
index 98e72f2b..1e79f482 100644
--- a/tests/account-video-tools.test.ts
+++ b/tests/account-video-tools.test.ts
@@ -69,6 +69,8 @@ const { listAccountProjects } = await import("@/server/account-projects");
const { listKatana } = await import("@/server/katana");
const { purgeAccount } = await import("@/server/account-sweep");
const { setSetting } = await import("@/server/settings");
+const { saveAccountKey } = await import("@/server/account-keys");
+const { RESTORE_ON_YOUR_GPU } = await import("@/server/restore");
const CLIP = fs.readFileSync(path.join(__dirname, "fixtures/shorts-12s.mp4"));
const src = { duration: 12, fps: 16, width: 72, height: 128, hasAudio: true };
@@ -505,6 +507,29 @@ describe("an account runs the video tools on its own ComfyUI", () => {
expect((await none.json()).code).not.toBe("own-gpu-tool");
});
+ it("keeps an account's Restore on its own GPU: a cloud run on its key answers before anything starts, whatever the install holds", async () => {
+ // A key-only account (its own fal.ai key, no GPU), with the owner's Hugging Face token set: the gated Restore
+ // IC-LoRA is in the install's reach, and still never goes with an account's key.
+ const k = auth.createAccount("[email protected]", "long enough").id;
+ cookies.k = `${auth.SESSION_COOKIE}=${auth.createSession(k).value}`;
+ saveAccountKey(k, "fal", "acct-fal-k-key:secret-k");
+ const kClip = await upload("k", CLIP, "video/mp4", "old-film.mp4");
+ setSetting("huggingfaceDownloadToken", "hf_owner_token_for_this_test");
+ try {
+ const cloud = await restoreRoute.POST(json("/api/restore", "POST", { engine: "cloud", source: { url: kClip, name: "old-film.mp4", ...src } }, "k"));
+ expect(cloud.status, await cloud.clone().text()).toBe(422);
+ expect((await cloud.json()).error).toBe(RESTORE_ON_YOUR_GPU);
+ expect(db().prepare("SELECT COUNT(*) AS n FROM generations WHERE json_extract(request_json, '$.account') = ?").get(k)).toEqual({ n: 0 });
+ // On its GPU's engine the same account is asked to connect one (the card), never refused.
+ const open = await restoreRoute.POST(json("/api/restore", "POST", { engine: "open", source: { url: kClip, name: "old-film.mp4", ...src } }, "k"));
+ expect(open.status).toBe(403);
+ expect(open.headers.get(access.CONNECT_GPU_HEADER)).toBe("1");
+ expect((await open.json()).code).toBe("connect-gpu");
+ } finally {
+ setSetting("huggingfaceDownloadToken", "");
+ }
+ });
+
it("an account's Katana runs go with the account", async () => {
const bClip = await upload("b", CLIP, "video/mp4", "b.mp4");
const bPic = await upload("b", TINY_PNG, "image/png", "b2.png");
diff --git a/tests/own-setup-flags.test.ts b/tests/own-setup-flags.test.ts
index bde7772f..a6654ccd 100644
--- a/tests/own-setup-flags.test.ts
+++ b/tests/own-setup-flags.test.ts
@@ -51,12 +51,24 @@ describe("own setup: the marks follow the GPU checks", () => {
it("drops an item's label once gpu-tested.json records its pass", async () => {
const before = await import("@/lib/own-setup");
- const ids = ["genjutsu:picture", "genjutsu:finish-faces", "genjutsu:object-change", "oss-h3-motion", "sound:clean-voice-first"];
+ const ids = ["genjutsu:picture", "genjutsu:finish-faces", "genjutsu:object-change", "oss-h3-motion", "sound:clean-voice-first", "video-tools:remove-person", "video-tools:remove-object-void"];
// Each has a setup of its own; it is the visitor's label until its pass is recorded.
for (const id of ids) expect(before.ownSetupItem(id), id).not.toBeNull();
+ // Removing a person with H3 and VOID haven't rendered on this studio's GPU yet: labelled today.
+ for (const id of ["video-tools:remove-person", "video-tools:remove-object-void"]) expect(before.ownSetupOnly(id), id).not.toBeNull();
vi.resetModules();
vi.doMock("../workflows/comfyui/gpu-tested.json", () => ({
- default: { features: { picture: { passed: true }, "finish-faces": { passed: true }, "object-change": { passed: true }, "motion-h3": { passed: true }, "clean-voice-first": { passed: true } } },
+ default: {
+ features: {
+ picture: { passed: true },
+ "finish-faces": { passed: true },
+ "object-change": { passed: true },
+ "motion-h3": { passed: true },
+ "clean-voice-first": { passed: true },
+ "remove-person": { passed: true },
+ "remove-object-void": { passed: true },
+ },
+ },
}));
const after = await import("@/lib/own-setup");
for (const id of ids) expect(after.ownSetupOnly(id), id).toBeNull();
diff --git a/tests/own-setup-routes.test.ts b/tests/own-setup-routes.test.ts
index 25a0ff48..5c14b2e0 100644
--- a/tests/own-setup-routes.test.ts
+++ b/tests/own-setup-routes.test.ts
@@ -3,8 +3,8 @@ import os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { accountProjectRoute, ownGpuRun } from "@/lib/guest-access";
-import { OWN_SETUP_IDS, ownSetupAction, ownSetupItem, ownSetupOnly } from "@/lib/own-setup";
-import { ownSetupOnlyNow } from "@/server/own-setup-live";
+import { OWN_SETUP_IDS, ownSetupAction, ownSetupGraphs, ownSetupItem, ownSetupLabel, ownSetupOnly } from "@/lib/own-setup";
+import { ownSetupOnlyNow, ownSetupsNow } from "@/server/own-setup-live";
/**
* Every surface that shows a "runs with your own setup" label leads somewhere an account can run it: a label next to a
@@ -72,6 +72,21 @@ describe("the label follows the GPU's validated graphs on the server", () => {
// Without graphs, the static answer: a 48 GB card stays a 48 GB card.
expect(ownSetupOnlyNow("regenerate:upscale", undefined, m)).toEqual(ownSetupOnly("regenerate:upscale"));
});
+
+ it("keeps Remove a person and VOID marked though ComfyUI accepted their graphs: only a real render on this studio's GPU lifts them", () => {
+ // The manifest's `validated` on these graphs is ComfyUI's check (queued with placeholder files, never run).
+ const m = manifest({ "video-person-remove-h3-relay": true, "video-person-remove-h3-mask": true, "video-erase-void": true });
+ const want = { "video-tools:remove-person": { need: "gpu", vramGb: 24 }, "video-tools:remove-object-void": { need: "gpu", vramGb: 40 } };
+ for (const [id, setup] of Object.entries(want)) {
+ expect(ownSetupGraphs(id), id).toEqual([]);
+ expect(ownSetupOnly(id), id).toEqual(setup);
+ expect(ownSetupOnlyNow(id, undefined, m), id).toEqual(setup);
+ }
+ expect(ownSetupsNow(Object.keys(want), m)).toEqual(want);
+ // Their labels say what to use, and wait for a pass of their own in gpu-tested.json (own-setup-flags.test.ts).
+ expect(ownSetupLabel(ownSetupOnly("video-tools:remove-object-void")!)).toBe("Runs on your own GPU · 40 GB");
+ expect(ownSetupLabel(ownSetupOnly("video-tools:remove-person")!)).toBe("Runs on your own GPU · 24 GB");
+ });
});
describe("the step's button", () => {
diff --git a/tests/own-setup.test.ts b/tests/own-setup.test.ts
index 1c1543a6..4dcf6e3d 100644
--- a/tests/own-setup.test.ts
+++ b/tests/own-setup.test.ts
@@ -180,4 +180,18 @@ describe("own setup: a press", () => {
expect(ownSetupStep(o, undefined)).toEqual({ kind: "run" });
}
});
+
+ it("says Restore & colourise runs on the visitor's own GPU only: a key alone opens Connect your GPU, not a run", () => {
+ // Its cloud engine carries the gated Restore IC-LoRA, which never goes with a visitor's key (an account's cloud run
+ // answers 422): the label promises no key, and a key-only account's press leads to its GPU.
+ const restore = ownSetupOnly("video-tools:restore")!;
+ expect(restore).toEqual({ need: "gpu", vramGb: 24, files: true });
+ expect(ownSetupLabel(restore)).toBe("Runs on your own GPU · 24 GB");
+ expect(ownSetupShort(restore)).toBe("Your GPU · 24 GB");
+ for (const text of [ownSetupLabel(restore), ownSetupShort(restore), ownSetupDetail(restore)]) expect(text).not.toMatch(/key|fal/i);
+ expect(ownSetupStep(restore, keyed)).toEqual({ kind: "connect-gpu", gpuOnly: true });
+ expect(ownSetupStep(restore, bare)).toEqual({ kind: "connect-gpu", gpuOnly: true });
+ expect(ownSetupStep(restore, gpu)).toEqual({ kind: "run" });
+ expect(ownSetupStep(restore, guest)).toEqual({ kind: "sign-up" });
+ });
});
diff --git a/tests/public-signup.test.ts b/tests/public-signup.test.ts
index c187243d..afc31f32 100644
--- a/tests/public-signup.test.ts
+++ b/tests/public-signup.test.ts
@@ -247,7 +247,7 @@ describe("accounts never run on the owner's keys or GPU", () => {
"/api/remove-object/preview",
"/api/remove-object/reroll",
"/api/katana/k1/retry",
- // Restore & colourise runs on its own GPU or fal.ai key.
+ // Restore & colourise runs on its own GPU.
"/api/restore",
]) {
const r = proxy(req(p, { method: "POST", cookie }));
diff --git a/tests/restore-signup.test.ts b/tests/restore-signup.test.ts
index 264f8833..0711d2b0 100644
--- a/tests/restore-signup.test.ts
+++ b/tests/restore-signup.test.ts
@@ -5,7 +5,7 @@ import { tempDir } from "./helpers/temp-dir";
/**
* Restore & colourise under the owner's public sign-up rules (docs/public-signup.md): its price
* check is open to guests and accounts and priced for their own GPU, never a demo; an account's run goes to its own GPU
- * or fal.ai key (a guest signs up first, an account with neither connects one), while the prompt writer, which asks the
+ * (a guest signs up first, an account without one connects one), while the prompt writer, which asks the
* studio's own AI helpers, stays the owner's (own-gpu-tool); the owner's are unchanged. The GPU pre-flight board has its row, on graphs the requirement index knows.
*/