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.

Dub: an account's price check reads only its own video

Adarsh79a71d1101e7
diff --git a/src/server/dub.ts b/src/server/dub.ts
index 443e6491..77234274 100644
--- a/src/server/dub.ts
+++ b/src/server/dub.ts
@@ -334,6 +334,8 @@ export function priceSteps(engine: Engine, steps: DubStep[], seconds?: number):
/** What starting this dub would cost (POST /api/dub?preview=1). */
export function previewDub(input: CreateDubInput): DubPrice {
if (input.mode === "oneshot" && input.engine === "open") throw new Error("One-shot dubbing is a cloud service — the open engine dubs step by step");
+ // An account prices only its own video (or one of Fuobe's examples): another's reads as a missing file.
+ if (tenantAccount() && !storedMedia(input.video)) throw new Error("That video is gone — add it again");
const seconds = videoLength(input.video, input.duration);
const targets = [...new Set(input.targets)];
if (input.mode === "oneshot") {
diff --git a/tests/account-audio.test.ts b/tests/account-audio.test.ts
index bbef4538..cc52b010 100644
--- a/tests/account-audio.test.ts
+++ b/tests/account-audio.test.ts
@@ -330,6 +330,17 @@ describe("an account dubs a video on its own ComfyUI, and its dubs are its own",
expect(p.costUsd).toBe(0);
});
+ it("never prices another account's video: it reads as a missing file", async () => {
+ const price = (video: string) => dubsRoute.POST(json("/api/dub?preview=1", "POST", { engine: "open", mode: "steps", video, targets: ["es"] }, "b"));
+ const missing = await price("/api/files/uploads/nothing-here.mp4");
+ const theirs = await price(clip);
+ expect(theirs.status).toBe(missing.status);
+ expect(theirs.status).toBe(422);
+ const said = (await theirs.json()) as { error: string; costUsd?: number };
+ expect(said).toEqual(await missing.json());
+ expect(said.error).toBe("That video is gone — add it again");
+ });
+
it("transcribes and translates on its own ComfyUI (never the AI helper), then voices a language end to end", async () => {
fake.log.length = 0;
fetched.length = 0;