|
1 | 1 | import { app } from "../../scripts/app"; |
2 | 2 | import { mergeIfValid, getWidgetConfig, setWidgetConfig } from "./widgetInputs"; |
3 | | -import { LiteGraph, LGraphCanvas } from "@comfyorg/litegraph"; |
| 3 | +import { LiteGraph, LGraphCanvas, LGraphNode } from "@comfyorg/litegraph"; |
4 | 4 |
|
5 | 5 | // Node that allows you to redirect connections for cleaner graphs |
6 | 6 |
|
7 | 7 | app.registerExtension({ |
8 | 8 | name: "Comfy.RerouteNode", |
9 | 9 | registerCustomNodes(app) { |
| 10 | + interface RerouteNode extends LGraphNode { |
| 11 | + __outputType?: string; |
| 12 | + } |
| 13 | + |
10 | 14 | class RerouteNode { |
| 15 | + static category: string | undefined; |
| 16 | + static defaultVisibility = false; |
| 17 | + |
11 | 18 | constructor() { |
12 | 19 | if (!this.properties) { |
13 | 20 | this.properties = {}; |
@@ -227,7 +234,7 @@ app.registerExtension({ |
227 | 234 | this.properties.showOutputText = !this.properties.showOutputText; |
228 | 235 | if (this.properties.showOutputText) { |
229 | 236 | this.outputs[0].name = |
230 | | - this.__outputType || this.outputs[0].type; |
| 237 | + this.__outputType || (this.outputs[0].type as string); |
231 | 238 | } else { |
232 | 239 | this.outputs[0].name = ""; |
233 | 240 | } |
@@ -273,7 +280,7 @@ app.registerExtension({ |
273 | 280 | app.graph.setDirtyCanvas(true, true); |
274 | 281 | } |
275 | 282 |
|
276 | | - computeSize() { |
| 283 | + computeSize(): [number, number] { |
277 | 284 | return [ |
278 | 285 | this.properties.showOutputText && this.outputs && this.outputs.length |
279 | 286 | ? Math.max( |
|
0 commit comments