mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
Fix
This commit is contained in:
parent
b4f434ee66
commit
1c40296d74
@ -75,7 +75,6 @@ class ComfyApi extends EventTarget {
|
|||||||
const view = new DataView(event.data);
|
const view = new DataView(event.data);
|
||||||
const eventType = view.getUint32(0);
|
const eventType = view.getUint32(0);
|
||||||
const buffer = event.data.slice(4);
|
const buffer = event.data.slice(4);
|
||||||
console.error("BINARY", eventType);
|
|
||||||
switch (eventType) {
|
switch (eventType) {
|
||||||
case 1:
|
case 1:
|
||||||
const view2 = new DataView(event.data);
|
const view2 = new DataView(event.data);
|
||||||
@ -89,8 +88,8 @@ class ComfyApi extends EventTarget {
|
|||||||
case 2:
|
case 2:
|
||||||
imageMime = "image/png"
|
imageMime = "image/png"
|
||||||
}
|
}
|
||||||
const jpegBlob = new Blob([buffer.slice(4)], { type: imageMime });
|
const imageBlob = new Blob([buffer.slice(4)], { type: imageMime });
|
||||||
this.dispatchEvent(new CustomEvent("b_preview", { detail: jpegBlob }));
|
this.dispatchEvent(new CustomEvent("b_preview", { detail: imageBlob }));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unknown binary websocket message of type ${eventType}`);
|
throw new Error(`Unknown binary websocket message of type ${eventType}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user