feat: trigger run in Photoshop
This commit is contained in:
Binary file not shown.
@@ -28,14 +28,17 @@
|
||||
});
|
||||
|
||||
socket.on('connect', () => {
|
||||
socket.emit('reset_changes');
|
||||
socket.emit('c_reset_changes');
|
||||
});
|
||||
socket.on('disconnect', () => {
|
||||
});
|
||||
socket.on('connect_error', () => {
|
||||
console.error('sdppp socket connect_error')
|
||||
});
|
||||
socket.on('trigger_graph_change', () => {
|
||||
socket.on('s_run', () => {
|
||||
document.getElementById('queue-button').click()
|
||||
});
|
||||
socket.on('s_trigger_graph_change', () => {
|
||||
api.dispatchEvent(new CustomEvent("graphChanged"));
|
||||
});
|
||||
setInterval(() => {
|
||||
@@ -93,9 +96,9 @@
|
||||
const mode0NodeTypes = currentState.nodes.filter(node => node.mode == 0).map(node => node.type);
|
||||
const containsSDPPPNodes = mode0NodeTypes.some(nodeType => SDPPPNodes.includes(nodeType));
|
||||
if (!containsSDPPPNodes) return;
|
||||
socket.emit('check_changes')
|
||||
socket.emit('c_check_changes')
|
||||
} catch (e) {
|
||||
console.error("[sd-ppp]", "Failed to check changes", e);
|
||||
}
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
||||
+12
-1
@@ -23,6 +23,10 @@
|
||||
this.$refreshSendLayer = null;
|
||||
this.$getterSaveAndClose = null;
|
||||
this.$senderSaveAndClose = null;
|
||||
|
||||
setTimeout(()=> {
|
||||
this.initSocket();
|
||||
})
|
||||
}
|
||||
|
||||
initDOM() {
|
||||
@@ -110,6 +114,13 @@
|
||||
this.socket.on('disconnect', () => {
|
||||
this.socketInited = false;
|
||||
});
|
||||
this.socket.on('s_run', () => {
|
||||
const tab = document.getElementById('tabs').querySelector('button.selected');
|
||||
const activeTabIndex = Array.prototype.indexOf.call(tab.parentElement.children, tab)
|
||||
if (activeTabIndex == 0) document.getElementById('txt2img_generate').click()
|
||||
if (activeTabIndex == 1) document.getElementById('img2img_generate').click()
|
||||
if (activeTabIndex == 2) document.getElementById('extras_generate').click()
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -294,4 +305,4 @@
|
||||
insertedSendWidget.set(el, widget);
|
||||
})
|
||||
})
|
||||
})();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user