mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 05:49:54 +00:00
Type LGraphNode.getInnerNodes (#2498)
This commit is contained in:
@@ -1287,7 +1287,7 @@ export class ComfyApp {
|
||||
|
||||
// Store all widget values
|
||||
if (widgets) {
|
||||
for (const i in widgets) {
|
||||
for (let i = 0; i < widgets.length; i++) {
|
||||
const widget = widgets[i]
|
||||
if (!widget.options || widget.options.serialize !== false) {
|
||||
inputs[widget.name] = widget.serializeValue
|
||||
@@ -1298,7 +1298,7 @@ export class ComfyApp {
|
||||
}
|
||||
|
||||
// Store all node links
|
||||
for (let i in node.inputs) {
|
||||
for (let i = 0; i < node.inputs.length; i++) {
|
||||
let parent = node.getInputNode(i)
|
||||
if (parent) {
|
||||
let link = node.getInputLink(i)
|
||||
@@ -1318,14 +1318,18 @@ export class ComfyApp {
|
||||
} else if (link && parent.mode === LGraphEventMode.BYPASS) {
|
||||
let all_inputs = [link.origin_slot]
|
||||
if (parent.inputs) {
|
||||
// @ts-expect-error convert list of strings to list of numbers
|
||||
all_inputs = all_inputs.concat(Object.keys(parent.inputs))
|
||||
for (let parent_input in all_inputs) {
|
||||
// @ts-expect-error assign string to number
|
||||
parent_input = all_inputs[parent_input]
|
||||
if (
|
||||
parent.inputs[parent_input]?.type === node.inputs[i].type
|
||||
) {
|
||||
// @ts-expect-error convert string to number
|
||||
link = parent.getInputLink(parent_input)
|
||||
if (link) {
|
||||
// @ts-expect-error convert string to number
|
||||
parent = parent.getInputNode(parent_input)
|
||||
}
|
||||
found = true
|
||||
@@ -1347,6 +1351,7 @@ export class ComfyApp {
|
||||
if (link) {
|
||||
inputs[node.inputs[i].name] = [
|
||||
String(link.origin_id),
|
||||
// @ts-expect-error link.origin_slot is already number.
|
||||
parseInt(link.origin_slot)
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user