Put ACE-Step music jobs on the same studio queue as video and image.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { startMusicJob } from '~/server/utils/musicChain'
|
||||
import { addStudioJob, kickStudioQueue, listStudioJobs, videoJobsBusy } from '~/server/utils/studioQueue'
|
||||
import { comfyConfigured } from '~/server/utils/comfy'
|
||||
import {
|
||||
clampLyricsStrength,
|
||||
@@ -67,27 +67,54 @@ export default defineEventHandler(async (event) => {
|
||||
engine: engine === 'ace-step-1.5' ? 'ace15' : 'ace'
|
||||
})
|
||||
|
||||
const job = await startMusicJob({
|
||||
const samplerName = String(body.sampler_name || 'euler')
|
||||
const scheduler = String(body.scheduler || 'simple')
|
||||
const familyId = crypto.randomUUID()
|
||||
const studio = await addStudioJob({
|
||||
ownerKey,
|
||||
folderId,
|
||||
name: clipName,
|
||||
tags,
|
||||
lyrics,
|
||||
duration,
|
||||
steps,
|
||||
seed,
|
||||
cfg,
|
||||
lyricsStrength,
|
||||
instrumental,
|
||||
folderLocked,
|
||||
engine,
|
||||
samplerName: String(body.sampler_name || 'euler'),
|
||||
scheduler: String(body.scheduler || 'simple')
|
||||
familyId,
|
||||
kind: 'music',
|
||||
payload: {
|
||||
prompt: tags,
|
||||
name: clipName,
|
||||
folderId,
|
||||
aspect: 'audio',
|
||||
width: 0,
|
||||
height: 0,
|
||||
steps,
|
||||
turbo: false,
|
||||
seed,
|
||||
cfg,
|
||||
fps: 0,
|
||||
samplerName,
|
||||
scheduler,
|
||||
duration,
|
||||
sound: !instrumental,
|
||||
workflow: 'v1',
|
||||
useIdentityRefs: false,
|
||||
hideThumbnail: false,
|
||||
folderLocked,
|
||||
referenceStillIds: [null, null, null, null],
|
||||
extensions: [],
|
||||
queueAutoRun: false,
|
||||
lyrics,
|
||||
instrumental,
|
||||
lyricsStrength,
|
||||
musicEngine: engine
|
||||
}
|
||||
})
|
||||
await kickStudioQueue()
|
||||
let latest = listStudioJobs(ownerKey).find(item => item.id === studio.id)
|
||||
if (!latest?.liveJobId && !(await videoJobsBusy())) {
|
||||
await kickStudioQueue()
|
||||
latest = listStudioJobs(ownerKey).find(item => item.id === studio.id)
|
||||
}
|
||||
const liveJobId = latest?.liveJobId || ''
|
||||
|
||||
return {
|
||||
jobId: job.id,
|
||||
queued: job.status === 'queued',
|
||||
jobId: liveJobId || studio.id,
|
||||
studioJobId: studio.id,
|
||||
queued: !liveJobId,
|
||||
seed,
|
||||
duration,
|
||||
steps,
|
||||
|
||||
Reference in New Issue
Block a user