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: an extended song keeps Remix, without the new part's lyrics standing in for the whole song

Claude9ed0946ab2a9
diff --git a/src/lib/output-actions.ts b/src/lib/output-actions.ts
index e75fb27c..4628397b 100644
--- a/src/lib/output-actions.ts
+++ b/src/lib/output-actions.ts
@@ -167,7 +167,8 @@ export function outputActions(g: Generation, index: number, ctx: ActionContext =
const song = typeof o.meta?.songId === "string" ? `&song=${q(o.meta.songId)}` : "";
link("extend-song", "Extend song", `/audio/song?model=mureka-extend&audio=${q(o.url)}${song}`);
if (!instrumentalSong(g)) {
- const words = lyricsOf(g.request?.params?.extra);
+ // The whole song's words: an extension's run holds only its new part's.
+ const words = g.op === "song-extend" ? "" : lyricsOf(g.request?.params?.extra);
const lyrics = words && q(words).length <= HANDOVER_LYRICS_MAX ? `&lyrics=${q(words)}` : "";
link("remix-song", "Remix", `/audio/song?model=mureka-remix&audio=${q(o.url)}${song}${lyrics}`);
}
@@ -230,6 +231,8 @@ const INSTRUMENTAL_WITHOUT_WORDS = new Set(["minimax-music-3", "oss-minimax-musi
/** A song with no vocals: an instrumental model's, one whose lyrics are only [Instrumental], or a model's own with no words. */
export function instrumentalSong(g: Pick<Generation, "modelId" | "op" | "request">): boolean {
if (INSTRUMENTAL_MODELS.has(g.modelId)) return true;
+ // An extension's lyrics are its new part's only: the song it extends may sing.
+ if (g.op === "song-extend") return false;
const words = lyricsOf(g.request?.params?.extra);
if (words) return isInstrumental(words);
return g.op === "music" && INSTRUMENTAL_WITHOUT_WORDS.has(g.modelId);
diff --git a/tests/music3-cloud.test.ts b/tests/music3-cloud.test.ts
index 76f5a3f3..3779c502 100644
--- a/tests/music3-cloud.test.ts
+++ b/tests/music3-cloud.test.ts
@@ -241,6 +241,9 @@ describe("a music result's song tools", () => {
expect(labels(gen({ modelId: "oss-ace-step" }))).toEqual(["Extend song", "Stems"]);
// A song Mureka writes words for from a description keeps Remix.
expect(labels(gen())).toEqual(["Extend song", "Remix", "Stems"]);
+ // An extension: its run's lyrics are the new part's only, so Remix stays and carries none.
+ const extended = gen({ op: "song-extend", modelId: "mureka-extend", request: { feature: "song-tools", modelId: "mureka-extend", params: { extra: { lyrics: "[Instrumental]" } } } });
+ expect(ids(extended).find((a) => a.id === "remix-song")!.href).toBe("/audio/song?model=mureka-remix&audio=%2Fapi%2Ffiles%2Fsong.mp3");
// A WAV song (fal's MiniMax Music 3 answers with one): no Stems.
const wav = { ...gen({ request: { feature: "audio", modelId: "minimax-music-3", params: { extra: { lyrics: "[Verse]\nla" } } } }), outputs: [{ url: "/api/files/song.wav", kind: "audio", contentType: "audio/wav" }] } as unknown as Generation;
expect(labels(wav)).toEqual(["Extend song", "Remix"]);