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.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Original sound: route tests for Genjutsu, Remove object and Character Swap Studio
Claude6136ad834c55
diff --git a/tests/genjutsu-api.test.ts b/tests/genjutsu-api.test.tsindex 406e0a29..ee57672d 100644--- a/tests/genjutsu-api.test.ts+++ b/tests/genjutsu-api.test.ts@@ -330,6 +330,18 @@ describe("Genjutsu: runs (demo)", () => {expect((await settle(final.id)).status).toBe("succeeded");});+ it("Original sound: the cloud refuses a split in words; your GPU splits the clip and puts back the chosen stem", async () => {+ const cloud = await createRoute.POST(json(body({ sound: { sound: "no-dialogue" } })));+ expect(cloud.status).toBe(422);+ expect((await cloud.json()).error).toMatch(/runs on your GPU \(open source\)/);+ const { final } = await run(body({ engine: "open", mode: "swap", subject: "the skateboard", references: [hero, hero], sound: { sound: "dialogue-only" } }));+ const rows = batchOf(final.id);+ expect(rows.filter((r) => r.op === "separate-audio").map((r) => r.model_id)).toEqual(["oss-dbs-separate"]);+ expect(final).toMatchObject({ modelId: "oss-mux", feature: "genjutsu" });+ expect(final.request.chain?.at(-1)).toEqual({ slot: "audio", stem: "voice" });+ expect((await settle(final.id)).status).toBe("succeeded");+ });+it("cloud swap by paint on one hosted VACE piece: the paint itself, no track", async () => {const { final } = await run(body({ mode: "swap", modelId: "wan-22-vace-inpaint", target: "paint", mask, range: { start: 0, end: 12 } }));const rows = batchOf(final.id);diff --git a/tests/remove-object-api.test.ts b/tests/remove-object-api.test.tsindex 528221aa..e03bd277 100644--- a/tests/remove-object-api.test.ts+++ b/tests/remove-object-api.test.ts@@ -297,6 +297,20 @@ describe("Remove object: runs", () => {expect(removal.request.prompt).toBe("the skater");});+ it("Original sound: the cloud refuses a split in words; your GPU's paint removal splits the cut and lowers the music", async () => {+ const cloud = await createRoute.POST(json(body({ modelId: "bria-video-erase", sound: { sound: "no-dialogue" } })));+ expect(cloud.status).toBe(422);+ expect((await cloud.json()).error).toMatch(/runs on your GPU \(open source\)/);+ const res = await createRoute.POST(json(body({ engine: "open", mode: "paint", prompt: undefined, mask, sound: { sound: "lower-music", musicDb: -18 } })));+ expect(res.status).toBe(201);+ const { final } = (await res.json()) as { final: Generation };+ const rows = batchOf(final.id);+ expect(rows.filter((r) => r.op === "separate-audio").map((r) => r.model_id)).toEqual(["oss-dbs-separate"]);+ expect(final).toMatchObject({ modelId: "oss-mux", feature: REMOVE.feature });+ expect(final.request.params?.extra).toMatchObject({ backgroundVolumeDb: -18 });+ expect((await settle(final.id)).status).toBe("succeeded");+ });+it("mask preview: SAM 3.1 on the first 2 s (cloud), the SAM 3 matte (open)", async () => {const cloud = (await (await previewRoute.POST(json(body({ requestId: "preview-cloud-1" })))).json()) as Generation;expect(cloud).toMatchObject({ feature: REMOVE.previewFeature, modelId: "sam-3-1-video-mask", op: "bg-remove-video", prompt: "the skateboard" });diff --git a/tests/swap-studio-api.test.ts b/tests/swap-studio-api.test.tsindex 8d2e7e91..93ec7851 100644--- a/tests/swap-studio-api.test.ts+++ b/tests/swap-studio-api.test.ts@@ -237,6 +237,10 @@ describe("Character Swap Studio: the cloud, as a demo", () => {expect(steps[0].request.params).toMatchObject({ extra: { width: 512, height: 910 } });expect(steps[4].request.params).toMatchObject({ extra: { target_fps: 24 } });expect(v.gens[asm.genId].url).toBeTruthy();+ // Original sound: the cloud puts back everything, and says another choice runs on your GPU.+ await expect(post(assemble, id, { clipId: c.id })).rejects.toThrow(/409: Already assembled/);+ await expect(post(assemble, id, { clipId: c.id, sound: { sound: "no-dialogue" } })).rejects.toThrow(/422: .*runs on your GPU \(open source\)/);+ await expect(post(assemble, id, { clipId: c.id, sound: { sound: "everything" } })).rejects.toThrow(/409: Already assembled/);// The step generations stay out of the Library; the assembled clip is in it.expect(gens.listGenerations({ feature: "swap-studio" }).map((g) => g.id)).toContain(asm.genId);});@@ -299,6 +303,21 @@ describe("Character Swap Studio: your GPU, as a demo", () => {expect(v.gens[first.id].master).toBeTruthy();expect(after.map((g) => g.selectedTake)).toEqual([t1.id, t2.id]);+ // Original sound on your GPU: the 24 fps copy's sound is split and its music and effects go back; the same takes with+ // another choice assemble again (only the same takes and the same choice are "already assembled").+ const asm = (await post(assemble, id, { clipId: c.id, sound: { sound: "no-dialogue" } })).clips[0].assembly;+ expect(asm.sound).toEqual({ sound: "no-dialogue" });+ const split = asm.stepIds.map((s: string) => gens.getGeneration(s)!).find((g: { op: string }) => g.op === "separate-audio");+ expect(split).toMatchObject({ modelId: "oss-dbs-separate" });+ expect(split.request.inputs?.video).toBe(v.project.clips[0].normalized!.url);+ expect(gens.getGeneration(asm.genId)!.request.chain?.at(-1)).toEqual({ slot: "audio", stem: "background" });+ await until(id, (x) => statusOf(x, x.project.clips[0].assembly?.genId) === "succeeded");+ await expect(post(assemble, id, { clipId: c.id, sound: { sound: "no-dialogue" } })).rejects.toThrow(/409: Already assembled/);+ const again = (await post(assemble, id, { clipId: c.id, sound: { sound: "dialogue-only" } })).clips[0].assembly;+ expect(again.genId).not.toBe(asm.genId);+ expect(gens.getGeneration(again.genId)!.request.chain?.at(-1)).toEqual({ slot: "audio", stem: "voice" });+ await until(id, (x) => statusOf(x, x.project.clips[0].assembly?.genId) === "succeeded");+// Segment 1 made stale (a new seed): "Queue from here" makes both again, segment 2 waiting on segment 1's new take.await patch(id, { type: "segment", clipId: c.id, shotId: shot.id, segmentId: segs[0].id, patch: { seed: 7 } });const q = await post(queue, id, { clipId: c.id, shotId: shot.id, segmentId: segs[0].id, mode: "from" });