Adapted theme from stable-diffusion-webui-ux

This commit is contained in:
space-nuko
2023-05-05 05:33:42 -05:00
parent 8fa267982e
commit 9afe6b21a2
15 changed files with 814 additions and 29 deletions

View File

@@ -3,12 +3,12 @@ import ComfyGraphNode from "./ComfyGraphNode";
import { Watch } from "@litegraph-ts/nodes-basic";
import type { SerializedPrompt } from "$lib/components/ComfyApp";
export interface ComfyAfterQueuedAction extends Record<any, any> {
export interface ComfyAfterQueuedEventProperties extends Record<any, any> {
prompt: SerializedPrompt
}
export class ComfyAfterQueuedAction extends ComfyGraphNode {
override properties: ComfyCopyActionProperties = {
export class ComfyAfterQueuedEvent extends ComfyGraphNode {
override properties: ComfyAfterQueuedEventProperties = {
prompt: null
}
@@ -41,8 +41,8 @@ export class ComfyAfterQueuedAction extends ComfyGraphNode {
}
LiteGraph.registerNodeType({
class: ComfyAfterQueuedAction,
title: "Comfy.AfterQueuedAction",
class: ComfyAfterQueuedEvent,
title: "Comfy.AfterQueuedEvent",
desc: "Triggers a 'bang' event when a prompt is queued.",
type: "actions/after_queued"
})

View File

@@ -15,7 +15,6 @@ 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
}
@@ -60,7 +59,6 @@ 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
@@ -215,7 +213,6 @@ 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)
}
}