mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-14 07:22:36 +08:00
fixed event for progress visual
This commit is contained in:
parent
8b4c09ab10
commit
583c3d2270
@ -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)
|
input_data_all = get_input_data(inputs, class_def, unique_id, outputs, prompt, extra_data)
|
||||||
if server.client_id is not None:
|
if server.client_id is not None:
|
||||||
server.last_node_id = unique_id
|
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)
|
obj = object_storage.get((unique_id, class_type), None)
|
||||||
if obj is None:
|
if obj is None:
|
||||||
|
|||||||
@ -65,36 +65,8 @@ app.registerExtension({
|
|||||||
|
|
||||||
// Map widgets
|
// Map widgets
|
||||||
subflow.extras.widgetSlots = {};
|
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;
|
const subflowNodes = subflow.nodes;
|
||||||
|
|
||||||
console.log(subflow.extras.widgetSlots);
|
|
||||||
let widgetIndex = 1;
|
let widgetIndex = 1;
|
||||||
for (const subflowNode of subflowNodes) {
|
for (const subflowNode of subflowNodes) {
|
||||||
const exports = subflowNode.properties?.exports;
|
const exports = subflowNode.properties?.exports;
|
||||||
@ -131,8 +103,6 @@ app.registerExtension({
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(subflow.extras.widgetSlots);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const refreshNode = (node, subflow, filename) => {
|
const refreshNode = (node, subflow, filename) => {
|
||||||
@ -143,8 +113,6 @@ app.registerExtension({
|
|||||||
refreshPins(node, subflow);
|
refreshPins(node, subflow);
|
||||||
refreshWidgets(node, subflow, false);
|
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);
|
node.size[0] = Math.max(100, LiteGraph.NODE_TEXT_SIZE * node.title.length * 0.45 + 100);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1623,11 +1623,10 @@ export class ComfyApp {
|
|||||||
for ( const [key, value] of Object.entries(subgraphPromptOutput) ) {
|
for ( const [key, value] of Object.entries(subgraphPromptOutput) ) {
|
||||||
output[key] = {
|
output[key] = {
|
||||||
...value,
|
...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);
|
Object.assign(globalMappings, subgraphGlobalMappings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1744,7 +1743,9 @@ export class ComfyApp {
|
|||||||
|
|
||||||
for (const o in output) {
|
for (const o in output) {
|
||||||
for (const i in output[o].inputs) {
|
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];
|
delete output[o].inputs[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user