diff --git a/src/lib/components/ComfyApp.svelte b/src/lib/components/ComfyApp.svelte index e9b3c88..26f0973 100644 --- a/src/lib/components/ComfyApp.svelte +++ b/src/lib/components/ComfyApp.svelte @@ -145,7 +145,6 @@ $: if (containerElem) { const canvas = containerElem.querySelector("#graph-canvas") if (canvas) { - console.warn("reg!"); const paneNode = canvas.closest(".splitpanes__pane") if (paneNode) { (paneNode as HTMLElement).ontransitionstart = () => { diff --git a/src/lib/components/ComfyProperties.svelte b/src/lib/components/ComfyProperties.svelte index ce208ff..3017b08 100644 --- a/src/lib/components/ComfyProperties.svelte +++ b/src/lib/components/ComfyProperties.svelte @@ -99,6 +99,13 @@ if (spec.canShow) return spec.canShow(widget); + if (widget.type === "widget" && spec.validNodeTypes) { + const node = (widget as WidgetLayout).node + if (!node) + return false; + return spec.validNodeTypes.indexOf(node.type) !== -1; + } + return spec.name in widget.attrs } diff --git a/src/lib/nodes/ComfyWidgetNodes.ts b/src/lib/nodes/ComfyWidgetNodes.ts index 518ed99..a1aa2dc 100644 --- a/src/lib/nodes/ComfyWidgetNodes.ts +++ b/src/lib/nodes/ComfyWidgetNodes.ts @@ -499,14 +499,13 @@ LiteGraph.registerNodeType({ }) export interface ComfyButtonProperties extends ComfyWidgetProperties { - message: string, - variant: string + param: string } export class ComfyButtonNode extends ComfyWidgetNode { override properties: ComfyButtonProperties = { defaultValue: false, - message: "bang" + param: "bang" } static slotLayout: SlotLayout = { @@ -525,8 +524,8 @@ export class ComfyButtonNode extends ComfyWidgetNode { onClick() { this.setValue(true) - this.triggerSlot(0, this.properties.message); - this.setValue(false) + this.triggerSlot(0, this.properties.param); + this.setValue(false) // TODO onRelease } constructor(name?: string) { diff --git a/src/lib/stores/layoutState.ts b/src/lib/stores/layoutState.ts index 3f059fe..e6e5ec5 100644 --- a/src/lib/stores/layoutState.ts +++ b/src/lib/stores/layoutState.ts @@ -416,7 +416,7 @@ const ALL_ATTRIBUTES: AttributesSpecList = [ // Button { - name: "message", + name: "param", type: "string", location: "nodeProps", editable: true,