Checkbox widget

This commit is contained in:
space-nuko
2023-05-06 19:53:33 -05:00
parent 0cf675f847
commit 707d6174dd
10 changed files with 210 additions and 32 deletions

View File

@@ -439,7 +439,7 @@ export default class ComfyApp {
const n = workflow.nodes.find((n) => n.id === node_.id);
if (!node_.isBackendNode) {
console.debug("Not serializing node: ", node_.type)
// console.debug("Not serializing node: ", node_.type)
continue;
}
@@ -564,8 +564,8 @@ export default class ComfyApp {
}
}
console.warn({ workflow, output })
console.warn(promptToGraphVis({ workflow, output }))
// console.debug({ workflow, output })
// console.debug(promptToGraphVis({ workflow, output }))
return { workflow, output };
}

View File

@@ -99,11 +99,16 @@
if (spec.canShow)
return spec.canShow(widget);
if (widget.type === "widget" && spec.validNodeTypes) {
const node = (widget as WidgetLayout).node
if (!node)
if (spec.validNodeTypes) {
if (widget.type === "widget") {
const node = (widget as WidgetLayout).node
if (!node)
return false;
return spec.validNodeTypes.indexOf(node.type) !== -1;
}
else if (widget.type === "container") {
return false;
return spec.validNodeTypes.indexOf(node.type) !== -1;
}
}
return spec.name in widget.attrs