Keep YuE2 jobs live on the bench and wire target length to semantic tokens.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,11 @@ function settings() {
|
||||
token: String(config.comfyControlToken || process.env.COMFY_CONTROL_TOKEN || '') }
|
||||
}
|
||||
export function yue2Configured() { return Boolean(settings().url) }
|
||||
function pendingRoot() { return join(String(useRuntimeConfig().libraryDir || process.env.LIBRARY_DIR || '/data/library'), 'yue2-pending') }
|
||||
export function yue2PendingAlive(jobId: string) {
|
||||
if (!jobId) return false
|
||||
return existsSync(join(pendingRoot(), `${jobId}.json`))
|
||||
}
|
||||
async function request(path: string, body?: unknown) {
|
||||
const { url, token } = settings()
|
||||
if (!url) throw new Error('YuE2 host is not configured. Set COMFY_CONTROL_URL.')
|
||||
@@ -26,7 +31,6 @@ async function request(path: string, body?: unknown) {
|
||||
}
|
||||
return response
|
||||
}
|
||||
function pendingRoot() { return join(String(useRuntimeConfig().libraryDir || process.env.LIBRARY_DIR || '/data/library'), 'yue2-pending') }
|
||||
function persist(job: Job) {
|
||||
mkdirSync(pendingRoot(), { recursive: true })
|
||||
const path = join(pendingRoot(), `${job.id}.json`)
|
||||
|
||||
Reference in New Issue
Block a user