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.

Results: a song's next steps are Extend song, Remix and Stems

Claudec37c34677e38
diff --git a/src/lib/output-actions.ts b/src/lib/output-actions.ts
index 6bc28eee..2515d3c9 100644
--- a/src/lib/output-actions.ts
+++ b/src/lib/output-actions.ts
@@ -252,7 +252,14 @@ export function nextSteps(g: Generation, index: number, max = 3, ctx: Pick<Actio
const at = ids.indexOf("upscale");
return at < 0 ? [...regen, ...ids] : [...ids.slice(0, at + 1), ...regen, ...ids.slice(at + 1)];
};
- const order: OutputActionId[] = o.kind === "video" ? [...(gradeOf(o) ? (["grade"] as const) : []), ...(withRegen(video) ?? [])] : (NEXT_STEPS[o.kind] ?? []);
+ // A song: its song tools first (where they're offered), then Split soundtrack.
+ const song: OutputActionId[] = ["extend-song", "remix-song", "song-stems", "split-soundtrack"];
+ const order: OutputActionId[] =
+ o.kind === "video"
+ ? [...(gradeOf(o) ? (["grade"] as const) : []), ...(withRegen(video) ?? [])]
+ : o.kind === "audio" && g.op && SONG_OPS.has(g.op) && all.some((a) => a.id === "extend-song")
+ ? song
+ : (NEXT_STEPS[o.kind] ?? []);
return order
.map((id) => all.find((a) => a.id === id && a.href))
.filter((a): a is OutputAction => !!a)
diff --git a/tests/music3-cloud.test.ts b/tests/music3-cloud.test.ts
index 5aa51422..d17ad7e7 100644
--- a/tests/music3-cloud.test.ts
+++ b/tests/music3-cloud.test.ts
@@ -9,7 +9,7 @@ import { getModel, getPreset } from "@/lib/catalog";
import { buildPayload, extractOutputs } from "@/lib/catalog/payload";
import { estimateCost, planGeneration } from "@/lib/catalog/plan";
import type { GenerationRequest, ModelRoute, Operation } from "@/lib/catalog/types";
-import { outputActions } from "@/lib/output-actions";
+import { nextSteps, outputActions } from "@/lib/output-actions";
import type { Generation } from "@/lib/catalog/types";
const route = (id: string, op?: Operation): ModelRoute => {
@@ -183,6 +183,11 @@ describe("a music result's song tools", () => {
expect(ids(gen({ modelId: "oss-minimax-music-3" }))[1].href).toBe("/audio/song?model=mureka-remix&audio=%2Fapi%2Ffiles%2Fsong.mp3");
});
+ it("are a song's next steps", () => {
+ expect(nextSteps(gen(), 0).map((a) => a.label)).toEqual(["Extend song", "Remix", "Stems"]);
+ expect(nextSteps(gen(), 0, 3, { engineMode: "open" }).map((a) => a.id)).toEqual(["lipsync", "voice-change", "split-soundtrack"]);
+ });
+
it("not on sound effects or speech, nor on an install that runs open models only", () => {
expect(ids(gen({ op: "sfx" }))).toEqual([]);
expect(ids(gen({ op: "tts" }))).toEqual([]);