Default workflow subgraph attribute

This commit is contained in:
space-nuko
2023-06-01 18:43:45 -05:00
parent e8539add51
commit b1dd8a6242
3 changed files with 18 additions and 1 deletions

View File

@@ -941,7 +941,11 @@ export default class ComfyApp {
if (workflow.attrs.queuePromptButtonRunWorkflow) { if (workflow.attrs.queuePromptButtonRunWorkflow) {
// Hold control to queue at the front // Hold control to queue at the front
const num = this.ctrlDown ? -1 : 0; const num = this.ctrlDown ? -1 : 0;
this.queuePrompt(workflow, num, 1); let tag = null;
if (workflow.attrs.queuePromptButtonDefaultWorkflow) {
tag = workflow.attrs.queuePromptButtonDefaultWorkflow
}
this.queuePrompt(workflow, num, 1, tag);
} }
} }

View File

@@ -681,6 +681,13 @@ const ALL_ATTRIBUTES: AttributesSpecList = [
editable: true, editable: true,
defaultValue: true defaultValue: true
}, },
{
name: "queuePromptButtonDefaultWorkflow",
type: "string",
location: "workflow",
editable: true,
defaultValue: ""
},
{ {
name: "showDefaultNotifications", name: "showDefaultNotifications",
type: "boolean", type: "boolean",

View File

@@ -57,6 +57,12 @@ export type WorkflowAttributes = {
*/ */
queuePromptButtonRunWorkflow: boolean, queuePromptButtonRunWorkflow: boolean,
/*
* Default subgraph to run if `queuePromptButtonRunWorkflow` is `true`. Set
* to blank to run the default subgraph (tagless).
*/
queuePromptButtonDefaultWorkflow: string,
/* /*
* If true, notifications will be shown when a prompt is queued and * If true, notifications will be shown when a prompt is queued and
* completed. Set to false if you need more detailed control over the * completed. Set to false if you need more detailed control over the