Tighten YuE lyrics validation and Comfy music workflow wiring.

Require section tags before queueing YuE and keep the ACE/YuE path changes that were already in progress.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-03 20:32:41 -05:00
co-authored by Cursor
parent 47f14d7be2
commit 17d4d4ffdc
8 changed files with 114 additions and 29 deletions
+16
View File
@@ -94,6 +94,22 @@ export function sanitizeMusicLyrics(raw: unknown, instrumental = false) {
return String(raw || '').replace(/\r\n/g, '\n').trim().slice(0, MUSIC_LYRICS_MAX)
}
/** YuE splits on [Section] headers. Returns how many sections are present. */
export function countYueLyricSections(lyrics: unknown) {
const text = String(lyrics || '')
const matches = text.match(/\[[^\]]+\]/g)
return matches ? matches.length : 0
}
export function yueLyricsProblem(lyrics: unknown): string | null {
const text = String(lyrics || '').trim()
if (!text) return 'YuE needs lyrics with section tags like [Verse 1] and [Chorus].'
if (countYueLyricSections(text) < 1) {
return 'YuE lyrics must include at least one [Section] tag (use the chips under Lyrics).'
}
return null
}
export function parseMusicSeed(raw: unknown) {
const text = String(raw ?? '').trim().toLowerCase()
if (!text || text === 'random') return Math.floor(Math.random() * 2_147_483_647)