fixed event for progress visual

This commit is contained in:
Sammy Franklin 2023-10-27 16:41:42 -07:00
parent 8b4c09ab10
commit 583c3d2270
3 changed files with 8 additions and 37 deletions

View File

@ -143,7 +143,9 @@ def recursive_execute(server, prompt, outputs, current_item, extra_data, execute
input_data_all = get_input_data(inputs, class_def, unique_id, outputs, prompt, extra_data)
if server.client_id is not None:
server.last_node_id = unique_id
server.send_sync("executing", { "node": unique_id, "prompt_id": prompt_id }, server.client_id)
subflow_node = prompt[unique_id].get('for_subflow')
executing_node = unique_id if subflow_node is None else subflow_node
server.send_sync("executing", { "node": executing_node, "prompt_id": prompt_id }, server.client_id)
obj = object_storage.get((unique_id, class_type), None)
if obj is None:

View File

@ -65,36 +65,8 @@ app.registerExtension({
// Map widgets
subflow.extras.widgetSlots = {};
// const resolveWidgetPath = (thisNode, path, widgetIndex) => {
// const subflowNodes = thisNode.subflow.nodes;
// let q = 0; // get what would be the q-th exported widget
// console.log(path);
// for (const subflowNode of subflowNodes) {
// const exportedWidgets = subflowNode.properties?.exports?.widgets;
// console.log("has nodes", q, widgetIndex);
// if (exportedWidgets) {
// console.log("in exports");
// const childPath = `${path}${subflowNode.id}/`;
// for (const i in exportedWidgets) {
// console.log("exported Widgets",q, widgetIndex);
// if (widgetIndex == q) {
// console.log(subflowNode);
// if (subflowNode.subflow) {
// console.log("widget is inside subflow!")
// return resolveWidgetPath(subflowNode, childPath, i);
// }
// return `${childPath}${subflowNode.id}/`;
// }
// q++;
// }
// }
// }
// console.warn("couldn't export a widget");
// };
const subflowNodes = subflow.nodes;
console.log(subflow.extras.widgetSlots);
let widgetIndex = 1;
for (const subflowNode of subflowNodes) {
const exports = subflowNode.properties?.exports;
@ -131,8 +103,6 @@ app.registerExtension({
}
}
console.log(subflow.extras.widgetSlots);
};
const refreshNode = (node, subflow, filename) => {
@ -143,8 +113,6 @@ app.registerExtension({
refreshPins(node, subflow);
refreshWidgets(node, subflow, false);
console.log("HAS", node.subflow.extras.inputSlots);
node.size[0] = Math.max(100, LiteGraph.NODE_TEXT_SIZE * node.title.length * 0.45 + 100);
};

View File

@ -1623,11 +1623,10 @@ export class ComfyApp {
for ( const [key, value] of Object.entries(subgraphPromptOutput) ) {
output[key] = {
...value,
for_subflow: String(node.id) // keep reference of root level subflow node
for_subflow: String(node.id) // keep reference of root node for progress and execution events
};
}
// childNodeIdOffset += subgraph.last_node_id;
Object.assign(globalMappings, subgraphGlobalMappings);
}
@ -1744,7 +1743,9 @@ export class ComfyApp {
for (const o in output) {
for (const i in output[o].inputs) {
if (Array.isArray(output[o].inputs[i]) && output[o].inputs[i].length === 2 && !output[output[o].inputs[i][0]]) {
if (Array.isArray(output[o].inputs[i])
&& output[o].inputs[i].length === 2
&& !output[output[o].inputs[i][0]]) {
delete output[o].inputs[i];
}
}