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

[Bug]: Always snap to grid not working since 1.4.3 #1601

Closed
TheToxin-git opened this issue Nov 19, 2024 · 15 comments · Fixed by #1604 or #1629
Closed

[Bug]: Always snap to grid not working since 1.4.3 #1601

TheToxin-git opened this issue Nov 19, 2024 · 15 comments · Fixed by #1604 or #1629
Assignees
Labels
Potential Bug Untriaged bug

Comments

@TheToxin-git
Copy link

TheToxin-git commented Nov 19, 2024

Frontend Version

1.4.3
1732004222_432266961

Expected Behavior

Groups and Nodes should snap to grid, when Always snap to grid is on

Actual Behavior

Groups and Nodes do not snap to grid, until shift-key is pressed, yet Always snap to grid is on (for demonstration purposes snap to grid size was set to 64):

snap_to_grid.mp4

Steps to Reproduce

Update to 1.4.3 and turn on Always snap to grid? idk
1732004284_824090828

Debug Logs

Total VRAM 11934 MB, total RAM 31887 MB
pytorch version: 2.5.1+cu124
xformers version: 0.0.28.post3
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3060 : cudaMallocAsync
Using xformers cross attention
Initializing frontend: Comfy-Org/ComfyUI_frontend@latest, requesting version details from GitHub...
[Prompt Server] web root: /home/thetoxin/root/downloads/github/ComfyUI/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.4.3
Skipping loading of custom nodes
Starting server

To see the GUI go to: http://127.0.0.1:8188

Browser Logs

Running on 127.0.0.1:8188 api.ts:56:12
ComfyUI Front-end version: 1.4.3 logging.ts:333:13
unreachable code after return statement three.module.js:8173:11
load and start tracking of workflow workflows/Unsaved Workflow.json workflowStore.ts:73:12
[workflowStore] open workflow workflows/Unsaved Workflow.json workflowStore.ts:191:12

Setting JSON

comfy.settings.json

What browsers do you use to access the UI ?

Mozilla Firefox

@TheToxin-git TheToxin-git added the Potential Bug Untriaged bug label Nov 19, 2024
@JorgeR81
Copy link

JorgeR81 commented Nov 19, 2024

Groups and Nodes do not snap to grid, until shift-key is pressed.

Yeah, I agree. I always want to snap to grid,
( on Windows 10, pressing Shift to many times, enables the "sticky keys" feature ).

Also, groups and nodes don't snap to grid when we resize them.
Not even if we press the Shift key, while resizing.

@LukeG89
Copy link

LukeG89 commented Nov 20, 2024

@huchenlei @webfiltered Snap to grid still doesn't work in 1.4.4, you still need to press Shift (tested both on Chrome and Edge)

Snap-To-Grid.mp4

Debug logs:

E:\>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --disable-all-custom-nodes --preview-size 1024 --front-end-version Comfy-Org/ComfyUI_frontend@latest
Total VRAM 8192 MB, total RAM 65277 MB
pytorch version: 2.6.0.dev20241115+cu124
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3070 Ti Laptop GPU : cudaMallocAsync
Using pytorch cross attention
Initializing frontend: Comfy-Org/ComfyUI_frontend@latest, requesting version details from GitHub...
[Prompt Server] web root: E:\ComfyUI\web_custom_versions\Comfy-Org_ComfyUI_frontend\1.4.4
Skipping loading of custom nodes
Starting server

To see the GUI go to: http://127.0.0.1:8188

Console logs:

Running on 127.0.0.1:8188
logging.ts:333 ComfyUI Front-end version: 1.4.4
Uncaught Error: NOT_REACHED
    at unsetKeybinding (keybindingStore.ts:234:11)
    at Proxy.loadUserKeybindings (keybindingStore.ts:259:23)
    at Proxy.wrappedAction (pinia.mjs:1405:26)
    at requestIdleCallback.timeout (GraphView.vue:152:28)

@TheToxin-git
Copy link
Author

TheToxin-git commented Nov 20, 2024

@LukeG89 Mine starts working after I re-enabled (Enabled -> Disabled -> Close Settings -> Open Settings -> Enabled) Always snap to grid option once. Try it. Maybe yours will work too.

On the console logs I have related issue, yet I do not formalized it properly. There is something wrong with keybindings migration to 1.4.3+. Keybindings are being reset after update and I believe that console error is related to that.

@LukeG89
Copy link

LukeG89 commented Nov 20, 2024

@LukeG89 Mine starts working after I re-enabled (Enabled -> Disabled -> Close Settings -> Open Settings -> Enabled) Always snap to grid option once. Try it. Maybe yours will work too.

Yes, now it's working! 🎉
Thanks for the tip!

On the console logs I have related issue, yet I do not formalized it properly yet. There is something wrong with keybindings migration to 1.4.3+. Keybindings are being reset after update and I believe that console error is related to that.

Yes, all my keybindings are gone too...

@LukeG89
Copy link

LukeG89 commented Nov 20, 2024

@webfiltered A different issue related to Snap to grid PR.

Apparently it broke guidelines from ComfyUI-Custom-Scripts

Guidelines-Gone.mp4

@LukeG89
Copy link

LukeG89 commented Nov 20, 2024

On the console logs I have related issue, yet I do not formalized it properly. There is something wrong with keybindings migration to 1.4.3+. Keybindings are being reset after update and I believe that console error is related to that.

@TheToxin-git I've reported the bug: #1612

@JorgeR81
Copy link

Mine starts working after I re-enabled (Enabled -> Disabled -> Close Settings -> Open Settings -> Enabled) Always snap to grid option once. Try it. Maybe yours will work too.

This also worked for me, but we still don't have snap to grid when resizing groups or nodes.

@JorgeR81
Copy link

Mine starts working after I re-enabled (Enabled -> Disabled -> Close Settings -> Open Settings -> Enabled) Always snap to grid option once. Try it. Maybe yours will work too.

When I restart ComfyUI, it stops working again.
So I have to repeat the process ( disable and reenable again ).

@JorgeR81
Copy link

When I restart ComfyUI, it stops working again. So I have to repeat the process ( disable and reenable again ).

@JorgeR81 Try disable it -> Refresh the page -> Enable it again

Ah, yes. It worked ! Thanks.

Now we only need snapping while resizing.

Is that supposed to be fixed here, or should I open a different issue ?

@webfiltered
Copy link
Contributor

@JorgeR81 I'll just open one - I had planned to implement this properly at some point.

@LukeG89
Copy link

LukeG89 commented Nov 21, 2024

@JorgeR81 Try disable it -> Refresh the page -> Enable it again

Ah, yes. It worked ! Thanks.

I deleted my comment because it only works in the current workflow, if you open a new one snap to grid doesn't work

@LukeG89
Copy link

LukeG89 commented Nov 21, 2024

@webfiltered Why is it only working in the first workflow?

Snap-To-Grid-Bug.mp4

@webfiltered
Copy link
Contributor

It's a per-workflow setting - I made a mistake on a last-minute alteration. Fixing it so it behaves as expected.

@huchenlei huchenlei reopened this Nov 21, 2024
@alessandroperilli
Copy link

alessandroperilli commented Nov 21, 2024

FYI, the fix was automatically enforced in v1.4.5. But when I upgraded to v1.4.6, I had to switch the toggle off and on again.
Without doing that, the Always Snap to Grid functionality seems broken again.


While we are at this, I have a question:

Both AlwaysSnaptoGrid and SHIFT+Drag to manually snap work fine with both nodes and groups. Thank you so much for that.

But the functionally doesn't seem to work when you try to resize nodes and groups (I tried with both Vivaldi and Safari on macOS). Is this by design, in the sense that the feature was never implemented? Or is it a bug?

If the former, I'd be happy to open a dedicated feature request. Thank you!

@webfiltered
Copy link
Contributor

Appreciate the info! I've just submitted a fix to resolve the underlying issue with snap to grid (movement).

Resize is up next. I was going to get some more framework stuff done first, but the community has really let the priorities be known on this one! 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Untriaged bug
Projects
None yet
6 participants