Replace Comfy YuE with standalone YuEGP profile 1

This commit is contained in:
Towsty
2026-09-07 20:24:47 -05:00
parent eeff12cdab
commit c2b6032e49
33 changed files with 976 additions and 294 deletions
+10 -1
View File
@@ -49,6 +49,10 @@ export default defineEventHandler(async (event) => {
payload.prompt = text(body.tags, 2000)
row.prompt = payload.prompt
}
if (body.yueProfile != null && row.kind === 'music' && payload.musicEngine === 'yue') {
if (body.yueProfile !== 1 && body.yueProfile !== 3) throw createError({ statusCode: 400, statusMessage: 'Choose YuEGP profile 1 or 3.' })
payload.yueProfile = body.yueProfile
}
if (body.lyrics != null) payload.lyrics = text(body.lyrics)
const instrumental = optionalBool(body.instrumental)
if (instrumental != null) payload.instrumental = instrumental
@@ -57,7 +61,12 @@ export default defineEventHandler(async (event) => {
if (body.promptPost != null) payload.promptPost = text(body.promptPost)
if (body.negative != null) payload.negative = text(body.negative, 2000)
const duration = optionalNumber(body.duration)
if (duration != null) payload.duration = Math.min(120, Math.max(0.5, duration))
if (duration != null) {
if (row.kind === 'music' && payload.musicEngine === 'yue') {
if (!Number.isInteger(duration) || duration < 30 || duration > 150) throw createError({ statusCode: 400, statusMessage: 'YuEGP duration must be 30–150 seconds.' })
payload.duration = duration
} else payload.duration = Math.min(120, Math.max(0.5, duration))
}
const steps = optionalNumber(body.steps)
if (steps != null) payload.steps = Math.min(100, Math.max(1, Math.round(steps)))
const cfg = optionalNumber(body.cfg)