mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-22 12:57:02 +08:00
Make input/widget conversion sub-menus optional
This commit is contained in:
parent
d64e217427
commit
01103ab1f5
@ -256,8 +256,18 @@ export function mergeIfValid(output, config2, forceUpdate, recreateWidget, confi
|
||||
return { customConfig };
|
||||
}
|
||||
|
||||
let useConversionSubmenusSetting;
|
||||
app.registerExtension({
|
||||
name: "Comfy.WidgetInputs",
|
||||
init() {
|
||||
useConversionSubmenusSetting = app.ui.settings.addSetting({
|
||||
id: "Comfy.NodeInputConversionSubmenus",
|
||||
name: "Node widget/input conversion sub-menus",
|
||||
tooltip: "In the node context menu, place the entries that convert between input/widget in sub-menus.",
|
||||
type: "boolean",
|
||||
defaultValue: true,
|
||||
});
|
||||
},
|
||||
async beforeRegisterNodeDef(nodeType, nodeData, app) {
|
||||
// Add menu options to conver to/from widgets
|
||||
const origGetExtraMenuOptions = nodeType.prototype.getExtraMenuOptions;
|
||||
@ -295,20 +305,28 @@ app.registerExtension({
|
||||
|
||||
//Convert.. main menu
|
||||
if (toInput.length) {
|
||||
options.push({
|
||||
content: `Convert input to 🔘..`,
|
||||
submenu: {
|
||||
options: toInput,
|
||||
},
|
||||
});
|
||||
if (useConversionSubmenusSetting.value) {
|
||||
options.push({
|
||||
content: `Convert input to 🔘..`,
|
||||
submenu: {
|
||||
options: toInput,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
options.push(...toInput, null);
|
||||
}
|
||||
}
|
||||
if (toWidget.length) {
|
||||
options.push({
|
||||
content: `Convert 🔘 to widget..`,
|
||||
submenu: {
|
||||
options: toWidget,
|
||||
},
|
||||
});
|
||||
if (useConversionSubmenusSetting.value) {
|
||||
options.push({
|
||||
content: `Convert 🔘 to widget..`,
|
||||
submenu: {
|
||||
options: toWidget,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
options.push(...toWidget, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user