fix: route video workspace to comfyui proxy

This commit is contained in:
boos
2026-05-21 17:27:41 +02:00
parent 9e7ce80574
commit 5ef3f8aea8
+28
View File
@@ -41,9 +41,37 @@ export default function ComfyUI() {
headers: { Authorization: `Bearer ${token}` },
});
if (!cancelled && response.ok) {
const payload = await response.json().catch(() => null);
const mode = String(payload?.comfyui?.mode || '').toLowerCase();
const status = String(payload?.comfyui?.status || '').toLowerCase();
const usesContainerProxy = mode === 'container';
if (usesContainerProxy) {
setIframeSrc(`/comfy/?token=${encodedToken}`);
return;
}
if (status !== 'disabled') {
setIframeSrc('/api/comfyui/proxy/');
return;
}
}
} catch {
// Fall through to the legacy embedded ComfyUI proxy.
}
try {
const response = await fetch('/api/video-agent/status', {
headers: { Authorization: `Bearer ${token}` },
});
if (!cancelled && response.ok) {
const payload = await response.json().catch(() => null);
const mode = String(payload?.mode || payload?.comfyui?.mode || '').toLowerCase();
if (mode === 'container') {
setIframeSrc(`/comfy/?token=${encodedToken}`);
return;
}
}
} catch {
// Fall through to the legacy embedded ComfyUI proxy.
}