-
Notifications
You must be signed in to change notification settings - Fork 415
Description
Custom Node Testing
- I have tried disabling custom nodes and the issue persists (see how to disable custom nodes if you need help)
Expected Behavior
Subgraphs are a really cool new feature but unfortunately have been released without sufficient testing. There are basic malfunctions and more subtle malfunctions, but I'll point out the most basic one here with some simple steps to reproduce.
I expect to be able to define subgraph blueprints and nest these within other subgraph blueprints in order to compose functionality into reusable layers of increasing sophistication.
Actual Behavior
Unfortunately if you do try to nest a subgraph inside another then the behaviour of the nested subgraph is unpredictable. Depending on the exact order of steps the resulting blueprint may be malformed. resulting in errors on load.
Steps to Reproduce
- Create an empty workflow
- Add any nodes you like, for example I just added a single String node to keep it really simple
- Select the nodes you just added and create a subgraph.
- Rename the subgraph to something memorable (e.g "Test Subgraph") and save it as a blueprint. (The idea here is that you have created a new, reusable subgraph component that you want to use in many workflows. This is the power of subgraphs and when the devs finally get them debugged they will definitely be a game -changer!)
- Clear the workflow
- Add some more nodes (a simple String node will do)
- Add the subgraph you just created from the Subgraph Blueprints in the node library
- Select these nodes and create a new subgraph, now with a nested subgraph within.
- Rename the subgraph to something memorable (e.g Test Nesting") and save as a blueprint. (The idea here is that you are create a slightly higher level reusable component that itself leverages reusable components your created earlier)
Unfortunately this nested subgraph is now malformed, as we shall see:
10) Clear the workflow and refresh the browser window
11) Add the new nested subgraph from Subgraph Blueprints
12) Expand it to see the subgraph. You will see a red box around the Test Subgraph because it is not defined anywhere.
Another way to see this problem is to try and edit the nested subgraph in the Subgraph Blueprints section. Pressing the edit button on the nested subgraph will open and editing window and again the Test Subgraph will be highlighted as undefined.
Further analysis reveals that the problem exists in the nested subgraph file itself, which you can find in the User/default/Subgraphs folder. If you read the json (use Visual Stude Code because you will need the autoformatting feature if you want to make any sense of this file) you will find a section where there is a list of subgraphs. In my very simple test example there were two subgraphs in this list: as expected, one subgraph (the Nested Subgraph) references the other subgraph (the Test Subgraph) using GUIDs and it appears that if the Nested Subgraph is first in the list then the Test Subgraph will fail to load because at this point it is not defined. Reversing the order of subgraphs in the JSON list makes this problem go away.
Note that you have to refresh the browser after editing the JSON file otherwise the frontend will use a cached version, making things very confusing!
Should be a simple fix for the devs but unfortunately this is just one of many such bugs that make this capability unusable at present
Debug Logs
Not needed to reproduceOther
I think the JSON processing needs to be a bit more sophisticated. You need to build dictionary by loading all the subgraphs before you try to dereference the subgraph id's, as the order in the list may not match the dependencies.
Transferred from: comfyanonymous/ComfyUI#10522
┆Issue is synchronized with this Notion page by Unito