Skip to content

Commit 743dc48

Browse files
authored
Add setting to disable missing nodes dialog (#571)
* Add setting to disable missing nodes dialog * nit * nit
1 parent 2c1bd66 commit 743dc48

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/scripts/app.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2157,12 +2157,20 @@ export class ComfyApp {
21572157
}
21582158

21592159
showMissingNodesError(missingNodeTypes, hasAddedNodes = true) {
2160-
if (this.vueAppReady)
2160+
if (
2161+
!this.ui.settings.getSettingValue(
2162+
'Comfy.Workflow.ShowMissingNodesWarning'
2163+
)
2164+
)
2165+
return
2166+
2167+
if (this.vueAppReady) {
21612168
showLoadWorkflowWarning({
21622169
missingNodeTypes,
21632170
hasAddedNodes,
21642171
maximizable: true
21652172
})
2173+
}
21662174

21672175
this.logging.addEntry('Comfy.App', 'warn', {
21682176
MissingNodes: missingNodeTypes

src/stores/settingStore.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ export const useSettingStore = defineStore('setting', {
165165
type: 'boolean',
166166
defaultValue: true
167167
})
168+
169+
app.ui.settings.addSetting({
170+
id: 'Comfy.Workflow.ShowMissingNodesWarning',
171+
name: 'Show missing nodes warning',
172+
type: 'boolean',
173+
defaultValue: true
174+
})
168175
},
169176

170177
set<K extends keyof Settings>(key: K, value: Settings[K]) {

src/types/apiTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ const zSettings = z.record(z.any()).and(
402402
'Comfy.CustomColorPalettes': colorPalettesSchema,
403403
'Comfy.ConfirmClear': z.boolean(),
404404
'Comfy.DevMode': z.boolean(),
405+
'Comfy.Workflow.ShowMissingNodesWarning': z.boolean(),
405406
'Comfy.DisableFloatRounding': z.boolean(),
406407
'Comfy.DisableSliders': z.boolean(),
407408
'Comfy.DOMClippingEnabled': z.boolean(),

0 commit comments

Comments
 (0)