mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 23:20:07 +00:00
* refactor: Reorganize Vue nodes system to domain-driven design architecture Move Vue nodes code from scattered technical layers to domain-focused structure: - Widget system → src/renderer/extensions/vueNodes/widgets/ - LOD optimization → src/renderer/extensions/vueNodes/lod/ - Layout logic → src/renderer/extensions/vueNodes/layout/ - Node components → src/renderer/extensions/vueNodes/components/ - Test structure mirrors source organization Benefits: - Clear domain boundaries instead of technical layers - Everything Vue nodes related in renderer domain (not workbench) - camelCase naming (vueNodes vs vue-nodes) - Tests co-located with source domains - All imports updated to new DDD structure * fix: Skip spatial index performance test on CI to avoid flaky timing Performance tests are inherently flaky on CI due to variable system performance. This test should only run locally like the other performance tests.
21 lines
719 B
TypeScript
21 lines
719 B
TypeScript
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
|
import type { IFileUploadWidget } from '@/lib/litegraph/src/types/widgets'
|
|
import type {
|
|
FileUploadInputSpec,
|
|
InputSpec as InputSpecV2
|
|
} from '@/schemas/nodeDef/nodeDefSchemaV2'
|
|
import type { ComfyWidgetConstructorV2 } from '@/scripts/widgets'
|
|
|
|
export const useFileUploadWidget = (): ComfyWidgetConstructorV2 => {
|
|
return (node: LGraphNode, inputSpec: InputSpecV2): IFileUploadWidget => {
|
|
const { name, options = {} } = inputSpec as FileUploadInputSpec
|
|
|
|
const widget = node.addWidget('fileupload', name, '', () => {}, {
|
|
serialize: true,
|
|
...(options as Record<string, unknown>)
|
|
}) as IFileUploadWidget
|
|
|
|
return widget
|
|
}
|
|
}
|