Store workflow ID and title in prompt extra data
This commit is contained in:
@@ -456,8 +456,8 @@ export default class ComfyApp {
|
||||
|
||||
this.api.addEventListener("executing", (promptID: PromptID | null, nodeID: ComfyNodeID | null) => {
|
||||
const queueEntry = queueState.executingUpdated(promptID, nodeID);
|
||||
if (queueEntry != null) {
|
||||
const workflow = workflowState.getWorkflow(queueEntry.workflowID);
|
||||
if (queueEntry != null && queueEntry.extraData?.workflowID != null) {
|
||||
const workflow = workflowState.getWorkflow(queueEntry.extraData.workflowID);
|
||||
workflow?.graph?.setDirtyCanvas(true, false);
|
||||
}
|
||||
});
|
||||
@@ -465,7 +465,7 @@ export default class ComfyApp {
|
||||
this.api.addEventListener("executed", (promptID: PromptID, nodeID: ComfyNodeID, output: SerializedPromptOutput) => {
|
||||
const queueEntry = queueState.onExecuted(promptID, nodeID, output)
|
||||
if (queueEntry != null) {
|
||||
const workflow = workflowState.getWorkflow(queueEntry.workflowID);
|
||||
const workflow = workflowState.getWorkflow(queueEntry.extraData.workflowID);
|
||||
if (workflow != null) {
|
||||
workflow.graph.setDirtyCanvas(true, false);
|
||||
const node = workflow.graph.getNodeByIdRecursive(nodeID) as ComfyGraphNode;
|
||||
@@ -808,7 +808,7 @@ export default class ComfyApp {
|
||||
tag = null;
|
||||
|
||||
this.processingQueue = true;
|
||||
let workflow;
|
||||
let workflow: ComfyWorkflow;
|
||||
|
||||
try {
|
||||
while (this.queueItems.length) {
|
||||
@@ -855,6 +855,8 @@ export default class ComfyApp {
|
||||
subgraphs: [tag]
|
||||
}
|
||||
},
|
||||
workflowID: workflow.id,
|
||||
workflowTitle: workflow.attrs.title,
|
||||
thumbnails
|
||||
}
|
||||
|
||||
|
||||
@@ -141,14 +141,11 @@
|
||||
const subgraphs: string[] | null = entry.extraData?.extra_pnginfo?.comfyBoxPrompt?.subgraphs;
|
||||
|
||||
let message = "Prompt";
|
||||
if (entry.workflowID != null) {
|
||||
const workflow = workflowState.getWorkflow(entry.workflowID);
|
||||
if (workflow != null && workflow.attrs.title) {
|
||||
message = `${workflow.attrs.title}`
|
||||
}
|
||||
if (subgraphs?.length > 0)
|
||||
message += ` (${subgraphs.join(', ')})`
|
||||
if (entry.extraData?.workflowTitle != null) {
|
||||
message = `${entry.extraData.workflowTitle}`
|
||||
}
|
||||
if (subgraphs?.length > 0)
|
||||
message += ` (${subgraphs.join(', ')})`
|
||||
|
||||
let submessage = `Nodes: ${Object.keys(entry.prompt).length}`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user