Skip to content

Mark unload nodes as OUTPUT_NODE so they execute as terminal nodes - #13

Open
axodouble wants to merge 3 commits into
SeanScripts:mainfrom
axodouble:add-output-node-flag
Open

axodouble wants to merge 3 commits into
SeanScripts:mainfrom
axodouble:add-output-node-flag

Conversation

@axodouble

Copy link
Copy Markdown

ComfyUI's executor only runs nodes reachable from output nodes, and a node is only an output node if its class sets OUTPUT_NODE = True.

As written, an UnloadModel / UnloadAllModels placed at the end of a workflow (the documented 'unload after encoding / at the end of a workflow' usage) with its output left unconnected was silently never executed, leaving models resident in VRAM.

So TLDR is that sometimes it will not unload models because it considers it a node that isn't necessary to be run.

ComfyUI's executor only runs nodes reachable from output nodes, and a node is only an output node if its class sets OUTPUT_NODE = True. As written, an UnloadModel / UnloadAllModels placed at the end of a workflow (the documented 'unload after encoding / at the end of a workflow' usage) with its output left unconnected was silently never executed, leaving models resident in VRAM.
@axodouble

Copy link
Copy Markdown
Author

I only just now see that I have made these changes on an older version hahahaha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant