Show ComfyUI audio outputs in portal
Test, build, and deploy ComfyUI Jobs / test-build (push) Successful in 3m57s
Test, build, and deploy ComfyUI Jobs / deploy (push) Successful in 15s
Test, build, and deploy ComfyUI Jobs / browser-test (push) Successful in 2m16s
Test, build, and deploy ComfyUI Jobs / qa-gate (push) Successful in 5s
Test, build, and deploy ComfyUI Jobs / test-build (push) Successful in 3m57s
Test, build, and deploy ComfyUI Jobs / deploy (push) Successful in 15s
Test, build, and deploy ComfyUI Jobs / browser-test (push) Successful in 2m16s
Test, build, and deploy ComfyUI Jobs / qa-gate (push) Successful in 5s
This commit is contained in:
@@ -45,7 +45,13 @@ function modelsFromPrompt(entry) {
|
||||
}
|
||||
return models.filter((model, index, all) => all.findIndex((item) => item.name === model.name) === index);
|
||||
}
|
||||
function assetType(asset) { return /\.(mp4|webm|mov|m4v)$/i.test(asset.filename) ? 'video' : 'image'; }
|
||||
function assetType(asset) {
|
||||
const declaredType = String(asset?.type || '').toLowerCase();
|
||||
if (declaredType === 'audio' || declaredType === 'video' || declaredType === 'image') return declaredType;
|
||||
if (/\.(mp3|flac|wav|ogg|oga|m4a|aac|opus)$/i.test(asset?.filename || '')) return 'audio';
|
||||
if (/\.(mp4|webm|mov|m4v)$/i.test(asset?.filename || '')) return 'video';
|
||||
return 'image';
|
||||
}
|
||||
function startComfyProgressSocket() {
|
||||
let WebSocket;
|
||||
try { WebSocket = require('ws'); } catch { return; }
|
||||
@@ -98,7 +104,13 @@ function startComfyProgressSocket() {
|
||||
function serverStatusFromStats(stats, queue) { const system = stats?.system || {}; const running = Array.isArray(queue?.queue_running) ? queue.queue_running.length : 0; const pending = Array.isArray(queue?.queue_pending) ? queue.queue_pending.length : 0; return { reachable: true, version: system.comfyui_version || '', os: system.os || '', pythonVersion: system.python_version || '', devices: (stats?.devices || []).map((device) => ({ name: device.name || device.type || 'Unknown device', type: device.type || '', vramTotal: device.vram_total || 0, vramFree: device.vram_free || 0 })), queue: { running, pending, total: running + pending } }; }
|
||||
function jobFromHistory(promptId, entry) {
|
||||
const outputs = Object.values(entry?.outputs || {});
|
||||
const assets = outputs.flatMap((output) => [...(output?.images || []), ...(output?.gifs || []), ...(output?.videos || [])]).filter((asset) => asset?.filename).map((asset) => ({ ...asset, type: assetType(asset), url: `/api/assets?filename=${encodeURIComponent(asset.filename)}&subfolder=${encodeURIComponent(asset.subfolder || '')}&type=${encodeURIComponent(asset.type || 'output')}` }));
|
||||
const assets = outputs.flatMap((output) => [
|
||||
...(output?.images || []),
|
||||
...(output?.gifs || []),
|
||||
...(output?.videos || []),
|
||||
...(output?.audio || []),
|
||||
...(output?.audios || []),
|
||||
]).filter((asset) => asset?.filename).map((asset) => ({ ...asset, type: assetType(asset), url: `/api/assets?filename=${encodeURIComponent(asset.filename)}&subfolder=${encodeURIComponent(asset.subfolder || '')}&type=${encodeURIComponent(asset.type || 'output')}` }));
|
||||
const metadata = extraData(entry);
|
||||
const progress = liveProgress.get(promptId);
|
||||
const startedAt = statusTimestamp(entry, 'execution_start') || executionStarts.get(promptId) || null;
|
||||
|
||||
Reference in New Issue
Block a user