Skip to content

[Bug]: Support for non-integer node id is broken #741

Closed
@Chaoses-Ib

Description

Frontend Version

v1.2.46

Expected Behavior

Loading generated images with API format workflow that has non-integer node ids works fine like the legacy frontend:

image

Actual Behavior

All nodes are stacked ontop of each other with no connections in the new frontend:

image

Steps to Reproduce

Example image:

ComfyUI_00036_

Debug Logs

N/A

Browser Logs

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'widgets')
    at app.ts:2827:33
    at ComfyApp.changeWorkflow (app.ts:2196:11)
    at ComfyApp.loadApiJson (app.ts:2803:10)
    at ComfyApp.handleFile (app.ts:2691:14)
    at async HTMLDocument.<anonymous> (app.ts:1018:9)
(anonymous) @ app.ts:2827
changeWorkflow @ app.ts:2196
loadApiJson @ app.ts:2803
handleFile @ app.ts:2691
await in handleFile
PysssssWorkflows.app.handleFile @ workflows.js:212
app.handleFile @ workflowImage.js:413
(anonymous) @ app.ts:1018

app.ts:2862  Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'widgets')
    at ComfyApp.loadApiJson (app.ts:2862:31)
    at ComfyApp.handleFile (app.ts:2691:14)
    at async HTMLDocument.<anonymous> (app.ts:1018:9)
loadApiJson @ app.ts:2862
handleFile @ app.ts:2691

What browsers do you use to access the UI ?

Microsoft Edge

Other

This parseInt() leads to the problem:

const node = app.graph.getNodeById(Number.parseInt(id))

Looks like graph uses Number as its id type? If so, it may be hard to directly fix this problem. But I think adding a preprocess step to map string ids to integer ids will work at least.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions