[Schema] ComfyNodeDefV2 schema (#2847)

This commit is contained in:
Chenlei Hu
2025-03-04 09:15:16 -05:00
committed by GitHub
parent 252e07ad17
commit f593f3caa4
10 changed files with 457 additions and 263 deletions

View File

@@ -1,6 +1,7 @@
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import type { InputSpec as InputSpecV2 } from '@/schemas/nodeDef/nodeDefSchemaV2'
import {
type ComboInputSpecV2,
type InputSpec,
@@ -8,8 +9,6 @@ import {
} from '@/schemas/nodeDefSchema'
import { ComfyWidgetConstructor, ComfyWidgets } from '@/scripts/widgets'
import type { BaseInputSpec } from './nodeDefStore'
export const useWidgetStore = defineStore('widget', () => {
const coreWidgets = ComfyWidgets
const customWidgets = ref<Record<string, ComfyWidgetConstructor>>({})
@@ -33,7 +32,7 @@ export const useWidgetStore = defineStore('widget', () => {
}
}
function inputIsWidget(spec: BaseInputSpec) {
function inputIsWidget(spec: InputSpecV2) {
return getWidgetType(spec.type, spec.name) !== null
}