Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck nodes when loading a graph w/ a node that has a forceInput input AND loads as collapsed #1448

Closed
rgthree opened this issue Sep 7, 2023 · 0 comments · Fixed by rgthree/rgthree-comfy#20
Labels
Bug Something is confirmed to not be working properly.

Comments

@rgthree
Copy link
Contributor

rgthree commented Sep 7, 2023

When loading a graph, if a node has a forceInput AND is starting collapsed, then it cannot be interacted with (dragged, un-collapsed) by clicking. (One can get to an unstuck state by using the menu to un-collapse, then it becomes draggable).

This is because the converted widget ends up with a widget.last_y of NaN upon which fails a test in litegraph.core later when attempting to interact.

FWIW, it seems like the fix is simple, at line 67 of widgetInputs.js:

If you want to keep it as undefined (which does pass litegraph's check):

	for (const widget of node.widgets) {
-		widget.last_y += LiteGraph.NODE_SLOT_HEIGHT;
+		if (typeof widget.last_y == 'number')
+			widget.last_y += LiteGraph.NODE_SLOT_HEIGHT;
	}

Or, if wanting to treat as 0 (I don't know which is preferable):

	for (const widget of node.widgets) {
-		widget.last_y += LiteGraph.NODE_SLOT_HEIGHT;
+		widget.last_y = (widget.last_y || 0) + LiteGraph.NODE_SLOT_HEIGHT;
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is confirmed to not be working properly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants