diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 3db9ceb6b..93e16f667 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -32,7 +32,6 @@ import { LiteGraph } from '@comfyorg/litegraph' import { StorageLocation } from '@/types/settingTypes' -import { LoadGraphDataOptions } from '@/types/comfy' // CSS imports. style.css must be imported later as it overwrites some litegraph styles. import '@comfyorg/litegraph/style.css' @@ -2208,13 +2207,8 @@ export class ComfyApp { clean: boolean = true, restore_view: boolean = true, workflow: string | null | ComfyWorkflow = null, - options: Partial = {} + { showMissingNodesDialog = false, showMissingModelsDialog = false } = {} ) { - const finalOptions: LoadGraphDataOptions = _.defaults(options, { - showMissingNodesDialog: true, - showMissingModelsDialog: true - }) - if (clean !== false) { this.clean() } @@ -2405,10 +2399,10 @@ export class ComfyApp { } // TODO: Properly handle if both nodes and models are missing (sequential dialogs?) - if (missingNodeTypes.length && finalOptions.showMissingNodesDialog) { + if (missingNodeTypes.length && showMissingNodesDialog) { this.showMissingNodesError(missingNodeTypes) } - if (missingModels.length && finalOptions.showMissingModelsDialog) { + if (missingModels.length && showMissingModelsDialog) { this.showMissingModelsError(missingModels) } await this.#invokeExtensionsAsync('afterConfigureGraph', missingNodeTypes) diff --git a/src/scripts/changeTracker.ts b/src/scripts/changeTracker.ts index 210cfd2cf..e4a4ddc07 100644 --- a/src/scripts/changeTracker.ts +++ b/src/scripts/changeTracker.ts @@ -72,10 +72,7 @@ export class ChangeTracker { if (prevState) { target.push(this.activeState) this.isOurLoad = true - await this.app.loadGraphData(prevState, false, false, this.workflow, { - showMissingModelsDialog: false, - showMissingNodesDialog: false - }) + await this.app.loadGraphData(prevState, false, false, this.workflow) this.activeState = prevState } } diff --git a/src/scripts/workflows.ts b/src/scripts/workflows.ts index 59d2ef698..ecd77f6a5 100644 --- a/src/scripts/workflows.ts +++ b/src/scripts/workflows.ts @@ -305,11 +305,7 @@ export class ComfyWorkflow { this.changeTracker.activeState, true, true, - this, - { - showMissingNodesDialog: false, - showMissingModelsDialog: false - } + this ) } else { const data = await this.getWorkflowData() diff --git a/src/types/comfy.d.ts b/src/types/comfy.d.ts index e1b5464e8..061b65644 100644 --- a/src/types/comfy.d.ts +++ b/src/types/comfy.d.ts @@ -100,19 +100,3 @@ export type ComfyObjectInfo = { } export type ComfyObjectInfoConfig = [string | any[]] | [string | any[], any] - -/** - * Defines the options for loading a graph state - */ -export interface LoadGraphDataOptions { - /** - * Whether to display a dialog if missing nodes are detected - * @default true - */ - showMissingNodesDialog: boolean - /** - * Whether to display a dialog if missing models are detected - * @default true - */ - showMissingModelsDialog: boolean -}