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.

Restore & colourise: an account without a GPU is asked for one when it adds a clip

Adarsh1dc08bc15f88
diff --git a/src/components/restore/restore-tool.tsx b/src/components/restore/restore-tool.tsx
index caf5ebd9..2d3ed145 100644
--- a/src/components/restore/restore-tool.tsx
+++ b/src/components/restore/restore-tool.tsx
@@ -177,6 +177,7 @@ export function RestoreTool({ setup }: { setup?: OwnSetup | null } = {}) {
<ClipDrop
accept={RESTORE.accept}
limits={LIMITS}
+ gpuOnly
onFile={(f) => {
// A visitor without its own GPU or key sets one up first (its files are kept for runs there).
if (!press(item)) return;
diff --git a/src/components/shorts/ui.tsx b/src/components/shorts/ui.tsx
index 5f0e2377..81510fc6 100644
--- a/src/components/shorts/ui.tsx
+++ b/src/components/shorts/ui.tsx
@@ -99,17 +99,20 @@ export function ClipDrop({
onFile,
onLibrary,
disabled,
+ gpuOnly,
}: {
accept: string;
limits: string;
onFile: (f: File) => void;
onLibrary: (url: string, name?: string) => void;
disabled?: boolean;
+ /** A tool no key runs (Restore & colourise): an account without a GPU is asked for one, even when it has a key. */
+ gpuOnly?: boolean;
}) {
const input = useRef<HTMLInputElement>(null);
const [over, setOver] = useState(false);
const [lib, setLib] = useState(false);
- const askFirst = useAskBeforeUpload();
+ const askFirst = useAskBeforeUpload({ gpuOnly });
return (
<div
aria-disabled={disabled || undefined}
diff --git a/tests/restore-signup.test.ts b/tests/restore-signup.test.ts
index 0711d2b0..ec063108 100644
--- a/tests/restore-signup.test.ts
+++ b/tests/restore-signup.test.ts
@@ -1,3 +1,5 @@
+import fs from "node:fs";
+import path from "node:path";
import { afterEach, beforeAll, describe, expect, it } from "vitest";
import { NextRequest } from "next/server";
import { tempDir } from "./helpers/temp-dir";
@@ -174,3 +176,16 @@ describe("the GPU pre-flight board", () => {
expect(idx.packs["ComfyUI-LTXVideo"]).toMatchObject({ commit: "220e1d45aa0469f518e982102fca4dca92a61862" });
});
});
+
+describe("the page a visitor sees", () => {
+ const page = (f: string) => fs.readFileSync(path.join(__dirname, "..", f), "utf8").replace(/\s+/g, " ");
+
+ it("is the GPU's: the open engine for a visitor, its upload asking for a GPU (no key runs it), and its price never 'Not available here'", () => {
+ const tool = page("src/components/restore/restore-tool.tsx");
+ expect(tool).toContain('const engine: Engine = visitor ? "open" : chosen;');
+ expect(tool).toMatch(/<ClipDrop accept=\{RESTORE\.accept\} limits=\{LIMITS\} gpuOnly /);
+ expect(tool).toContain("{costText(est, engine)}");
+ expect(page("src/components/shorts/ui.tsx")).toContain("useAskBeforeUpload({ gpuOnly })");
+ expect(page("src/components/shorts/ui.tsx")).not.toContain("Not available here");
+ });
+});