rgthree / rgthree-comfy

Making ComfyUI more comfortable!
MIT License
1.16k stars 81 forks source link

[BUG] Nodes don't seem to support the "Lock" feature #104

Closed ghostsquad closed 3 months ago

ghostsquad commented 10 months ago

Comfy added the ability to "Lock" nodes (prevent them from moving). Nodes here don't show "lock" in the context menu.

ghostsquad commented 10 months ago

Update, not all nodes seem to support this. Context appears to show "lock". Fast Bypasser/Muter, Reroute, and Any Switch (there may be more) don't show "lock" in the context menu.

ghostsquad commented 10 months ago

Context Node, when locked, is still moveable.

aphaits commented 6 months ago

Saw this issue thread +1 feature request for lock ability for reroute nodes

sfisher commented 3 months ago

Agree. The image comparer doesn't lock. I accidentally click on it when trying to move the canvas around and move the control by mistake instead of the canvas since my compare image is large. (I know I can use space+mouse, but I don't always rember to use it). It shows the "lock" icon in the corner but can still be moved.

It would be nice if the controls respected the lock so that if you accidentally click and drag them, they don't go someplace wonky.

rgthree commented 3 months ago

Sorry, I looked into this months ago and forgot to reply, I guess.

First, "Lock" is not a base-install ComfyUI feature, though "Pin" is and does the same thing AFAICT (at least for locking the position). You don't get a fancy lock icon with "Pin" though.

The "Lock" feature comes from the ComfyUI-Custom-Scripts and, unfortunately, the way it has been implemented there is not compatible with the core GraphNode class in base LiteGraph library (which is the frontend JS library that does all the work for Comfy).

Note, a lot of other nodes use an overridden ComfyUI Node which is why other nodes seem to be working with the ComfyUI-Custom-Scripts (but not all, for instance the base "Note" node you cannot "Lock" butcan "Pin"). Nearly all the rgthree-comfy nodes uses the core LiteGraph GraphNode to do much cooler stuff and avoid the constant breakages and general inflexibility with the ComfyUI Node variant.

Unfortunately, I can't really fix it from rgthree-comfy code, since it's actually an incompatibility between LiteGraph and ComfyUI-Custom-Scripts. You could file a bug with the ComfyUI-Custom-Scripts nodes that Locking doesn't work with the core LiteGraph GraphNode (and, therefore, rgthree-comfy nodes), or use "Pin".