mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-22 05:47:02 +08:00
feat: ✨ add a method to extend convertable widget types
This commit is contained in:
parent
b1fd26fe9e
commit
c1bf0ab92c
@ -12,6 +12,12 @@ export function getWidgetConfig(slot) {
|
|||||||
return slot.widget[CONFIG] ?? slot.widget[GET_CONFIG]();
|
return slot.widget[CONFIG] ?? slot.widget[GET_CONFIG]();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function addValidType(type) {
|
||||||
|
if (!VALID_TYPES.includes(type)) {
|
||||||
|
VALID_TYPES.push(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getConfig(widgetName) {
|
function getConfig(widgetName) {
|
||||||
const { nodeData } = this.constructor;
|
const { nodeData } = this.constructor;
|
||||||
return nodeData?.input?.required[widgetName] ?? nodeData?.input?.optional?.[widgetName];
|
return nodeData?.input?.required[widgetName] ?? nodeData?.input?.optional?.[widgetName];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user