Updates for backend list type in object_info
This commit is contained in:
@@ -245,7 +245,7 @@ export default class ComfyApp {
|
||||
|
||||
const node: LGraphNodeConstructor = {
|
||||
class: ctor,
|
||||
title: nodeData.name,
|
||||
title: nodeData.display_name || nodeData.name,
|
||||
type: nodeId,
|
||||
desc: `ComfyNode: ${nodeId}`
|
||||
}
|
||||
|
||||
@@ -2,19 +2,21 @@ import LGraphCanvas from "@litegraph-ts/core/src/LGraphCanvas";
|
||||
import ComfyGraphNode from "./ComfyGraphNode";
|
||||
import ComfyWidgets from "$lib/widgets"
|
||||
import type { ComfyWidgetNode, ComfyExecutionResult } from "./ComfyWidgetNodes";
|
||||
import { BuiltInSlotType, type SerializedLGraphNode } from "@litegraph-ts/core";
|
||||
import { BuiltInSlotShape, BuiltInSlotType, type SerializedLGraphNode } from "@litegraph-ts/core";
|
||||
import type IComfyInputSlot from "$lib/IComfyInputSlot";
|
||||
import type { ComfyInputConfig } from "$lib/IComfyInputSlot";
|
||||
|
||||
/*
|
||||
* Base class for any node with configuration sent by the backend.
|
||||
* Base class for any node wit configuration sent by the backend.
|
||||
*/
|
||||
export class ComfyBackendNode extends ComfyGraphNode {
|
||||
comfyClass: string;
|
||||
displayName: string | null;
|
||||
|
||||
constructor(title: string, comfyClass: string, nodeData: any) {
|
||||
super(title)
|
||||
this.type = comfyClass; // XXX: workaround dependency in LGraphNode.addInput()
|
||||
this.displayName = nodeData.display_name;
|
||||
this.comfyClass = comfyClass;
|
||||
this.isBackendNode = true;
|
||||
|
||||
@@ -32,6 +34,7 @@ export class ComfyBackendNode extends ComfyGraphNode {
|
||||
}
|
||||
}
|
||||
|
||||
// comfy class -> input name -> input config
|
||||
private static defaultInputConfigs: Record<string, Record<string, ComfyInputConfig>> = {}
|
||||
|
||||
private setup(nodeData: any) {
|
||||
@@ -43,7 +46,7 @@ export class ComfyBackendNode extends ComfyGraphNode {
|
||||
ComfyBackendNode.defaultInputConfigs[this.type] = {}
|
||||
|
||||
for (const inputName in inputs) {
|
||||
const config = { minWidth: 1, minHeight: 1 };
|
||||
const config: Partial<IComfyInputSlot> = {};
|
||||
|
||||
const inputData = inputs[inputName];
|
||||
const type = inputData[0];
|
||||
@@ -67,13 +70,14 @@ export class ComfyBackendNode extends ComfyGraphNode {
|
||||
}
|
||||
|
||||
if ("widgetNodeType" in config)
|
||||
ComfyBackendNode.defaultInputConfigs[this.type][config.name] = config.config
|
||||
ComfyBackendNode.defaultInputConfigs[this.type][inputName] = (config as IComfyInputSlot).config
|
||||
}
|
||||
|
||||
for (const o in nodeData["output"]) {
|
||||
const output = nodeData["output"][o];
|
||||
const outputName = nodeData["output_name"][o] || output;
|
||||
this.addOutput(outputName, output);
|
||||
const outputShape = nodeData["output_is_list"][o] ? BuiltInSlotShape.GRID_SHAPE : BuiltInSlotShape.CIRCLE_SHAPE;
|
||||
this.addOutput(outputName, output, { shape: outputShape });
|
||||
}
|
||||
|
||||
this.serialize_widgets = false;
|
||||
|
||||
Reference in New Issue
Block a user