diff --git a/src/extensions/core/widgetInputs.ts b/src/extensions/core/widgetInputs.ts index 879e79976..3237c2839 100644 --- a/src/extensions/core/widgetInputs.ts +++ b/src/extensions/core/widgetInputs.ts @@ -19,7 +19,7 @@ import { addValueControlWidgets, isValidWidgetType } from '@/scripts/widgets' -import { CONFIG, GET_CONFIG } from '@/services/litegraphService' +import { CONFIG, GET_CONFIG } from '@/lib/litegraph/constants' import { mergeInputSpec } from '@/utils/nodeDefUtil' import { applyTextReplacements } from '@/utils/searchAndReplace' import { isPrimitiveNode } from '@/renderer/utils/nodeTypeGuards' diff --git a/src/lib/litegraph/constants.ts b/src/lib/litegraph/constants.ts new file mode 100644 index 000000000..1a4299010 --- /dev/null +++ b/src/lib/litegraph/constants.ts @@ -0,0 +1,14 @@ +/** + * Symbols used for widget configuration in litegraph nodes. + * Extracted to break circular dependencies between litegraphService and extensions. + */ + +/** + * Symbol used to access the config object on a widget. + */ +export const CONFIG = Symbol('CONFIG') + +/** + * Symbol used to access the config getter function on a widget. + */ +export const GET_CONFIG = Symbol('GET_CONFIG') diff --git a/src/services/litegraphService.ts b/src/services/litegraphService.ts index 18d281973..ed2bd510a 100644 --- a/src/services/litegraphService.ts +++ b/src/services/litegraphService.ts @@ -1,5 +1,7 @@ import _ from 'es-toolkit/compat' +import { CONFIG, GET_CONFIG } from '@/lib/litegraph/constants' +export { CONFIG, GET_CONFIG } import { downloadFile } from '@/base/common/downloadUtil' import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems' import { useSubgraphOperations } from '@/composables/graph/useSubgraphOperations' @@ -68,9 +70,6 @@ export interface HasInitialMinSize { _initialMinSize: { width: number; height: number } } -export const CONFIG = Symbol() -export const GET_CONFIG = Symbol() - /** * Service that augments litegraph with ComfyUI specific functionality. */