fix: route video workspace to comfyui proxy
This commit is contained in:
@@ -41,8 +41,36 @@ export default function ComfyUI() {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
if (!cancelled && response.ok) {
|
||||
setIframeSrc(`/comfy/?token=${encodedToken}`);
|
||||
return;
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user