mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 02:02:08 +00:00
[Type] Disallow type upcasting for node input spec (#2790)
This commit is contained in:
@@ -74,11 +74,13 @@ export const useLitegraphService = () => {
|
||||
if (widgetType === 'COMBO') {
|
||||
Object.assign(
|
||||
config,
|
||||
// @ts-expect-error InputSpec is not typed correctly
|
||||
app.widgets.COMBO(this, inputName, inputData, app) || {}
|
||||
)
|
||||
} else {
|
||||
Object.assign(
|
||||
config,
|
||||
// @ts-expect-error InputSpec is not typed correctly
|
||||
app.widgets[widgetType](this, inputName, inputData, app) || {}
|
||||
)
|
||||
}
|
||||
@@ -95,6 +97,7 @@ export const useLitegraphService = () => {
|
||||
...shapeOptions,
|
||||
localized_name: st(nameKey, inputName)
|
||||
}
|
||||
// @ts-expect-error InputSpec is not typed correctly
|
||||
this.addInput(inputName, type, inputOptions)
|
||||
widgetCreated = false
|
||||
}
|
||||
@@ -104,15 +107,19 @@ export const useLitegraphService = () => {
|
||||
if (!inputIsRequired) {
|
||||
config.widget.options.inputIsOptional = true
|
||||
}
|
||||
// @ts-expect-error InputSpec is not typed correctly
|
||||
if (inputData[1]?.forceInput) {
|
||||
config.widget.options.forceInput = true
|
||||
}
|
||||
// @ts-expect-error InputSpec is not typed correctly
|
||||
if (inputData[1]?.defaultInput) {
|
||||
config.widget.options.defaultInput = true
|
||||
}
|
||||
// @ts-expect-error InputSpec is not typed correctly
|
||||
if (inputData[1]?.advanced) {
|
||||
config.widget.advanced = true
|
||||
}
|
||||
// @ts-expect-error InputSpec is not typed correctly
|
||||
if (inputData[1]?.hidden) {
|
||||
config.widget.hidden = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user