feature: show ComfyProgress in photoshop

This commit is contained in:
zombieyang
2024-07-18 12:53:37 +08:00
parent 0372de681d
commit a70901ea0b
6 changed files with 88 additions and 21 deletions
+14 -9
View File
@@ -9,7 +9,20 @@
let layerStrs = [];
let boundsStrs = [];
let setLayerStrs = [];
let socket = null;
let socket = socketio(location.origin, {
transports: ["websocket"],
path: '/sd-ppp/',
query: {
api_level: 2,
type: 'comfyui'
}
});
api.addEventListener("progress", ({ detail }) => {
if (!detail || isNaN(detail.value / detail.max)) return;
socket.emit('c_progress', {
progress: Math.round(detail.value / detail.max * 100)
});
});
console.log("[sd-ppp]", "Loading js extension");
const id = "Comfy.SD-PPP"
@@ -42,14 +55,6 @@
},
async setup() {
socket = socketio(location.origin, {
transports: ["websocket"],
path: '/sd-ppp/',
query: {
api_level: 2,
type: 'comfyui'
}
});
socket.on('connect', () => {
socket.emit('c_reset_changes');