Node hidden property

This commit is contained in:
space-nuko
2023-05-05 02:11:07 -05:00
parent 7f64b743a7
commit 8fa267982e
7 changed files with 230 additions and 65 deletions

View File

@@ -15,6 +15,7 @@ import type { FileData as GradioFileData } from "@gradio/upload";
import queueState from "$lib/stores/queueState";
export interface ComfyWidgetProperties extends Record<string, any> {
hidden?: boolean,
defaultValue: any
}
@@ -59,6 +60,7 @@ export abstract class ComfyWidgetNode<T = any> extends ComfyGraphNode {
constructor(name: string, value: T) {
const color = LGraphCanvas.node_colors["blue"]
super(name)
this.setProperty("hidden", false)
this.value = writable(value)
this.color ||= color.color
this.bgColor ||= color.bgColor
@@ -213,6 +215,7 @@ export abstract class ComfyWidgetNode<T = any> extends ComfyGraphNode {
override onConfigure(o: SerializedLGraphNode) {
this.value.set((o as any).comfyValue);
this.shownOutputProperties = (o as any).shownOutputProperties;
this.setProperty("hidden", false)
}
}