mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-20 21:37:00 +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]();
|
||||
}
|
||||
|
||||
export function addValidType(type) {
|
||||
if (!VALID_TYPES.includes(type)) {
|
||||
VALID_TYPES.push(type);
|
||||
}
|
||||
}
|
||||
|
||||
function getConfig(widgetName) {
|
||||
const { nodeData } = this.constructor;
|
||||
return nodeData?.input?.required[widgetName] ?? nodeData?.input?.optional?.[widgetName];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user