From 252e07ad17e8589bb3f302b03630c7c335b581dd Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Tue, 4 Mar 2025 23:10:09 +1100 Subject: [PATCH] [Workaround] Fix #2849 with runtime type guard (#2850) --- src/composables/widgets/useStringWidget.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/composables/widgets/useStringWidget.ts b/src/composables/widgets/useStringWidget.ts index 411b7596f..c10fed32f 100644 --- a/src/composables/widgets/useStringWidget.ts +++ b/src/composables/widgets/useStringWidget.ts @@ -1,6 +1,6 @@ import type { IWidget, LGraphNode } from '@comfyorg/litegraph' -import { type InputSpec, isStringInputSpec } from '@/schemas/nodeDefSchema' +import { type InputSpec } from '@/schemas/nodeDefSchema' import type { ComfyWidgetConstructor } from '@/scripts/widgets' import { useSettingStore } from '@/stores/settingStore' import type { ComfyApp } from '@/types' @@ -64,10 +64,6 @@ export const useStringWidget = () => { inputData: InputSpec, app: ComfyApp ) => { - if (!isStringInputSpec(inputData)) { - throw new Error(`Invalid input data: ${inputData}`) - } - const inputOptions = inputData[1] ?? {} const defaultVal = inputOptions.default ?? '' const multiline = inputOptions.multiline @@ -86,7 +82,7 @@ export const useStringWidget = () => { } } - if (inputOptions.dynamicPrompts != undefined) { + if (typeof inputOptions.dynamicPrompts === 'boolean') { res.widget.dynamicPrompts = inputOptions.dynamicPrompts }