mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-11 22:12:33 +08:00
23 lines
502 B
JavaScript
23 lines
502 B
JavaScript
import { ComfyApp, app } from "../../scripts/app.js";
|
|
|
|
app.registerExtension({
|
|
name: "Comfy.comboBoolMigration",
|
|
|
|
nodeCreated(node, app) {
|
|
for(let i in node.widgets) {
|
|
let widget = node.widgets[i];
|
|
|
|
if(widget.type == "toggle") {
|
|
let value = widget.value;
|
|
Object.defineProperty(widget, "value", {
|
|
set: (value) => {
|
|
delete widget.value;
|
|
widget.value = value == true || value == widget.options.on;
|
|
},
|
|
get: () => { return value; }
|
|
});
|
|
}
|
|
}
|
|
}
|
|
});
|