comfyanonymous / ComfyUI

The most powerful and modular stable diffusion GUI, api and backend with a graph/nodes interface.
GNU General Public License v3.0
40.96k stars 4.36k forks source link

Mouse click coordinates wrong when you leave ComfyUI on a long time. #2627

Open michaelLochlann opened 5 months ago

michaelLochlann commented 5 months ago

Issue: Click the mouse. What actually gets selected in ComfyUI is far off from where you actually clicked. Not only are you unable to interact with ComfyUI properly but you usually mess up your graph because you are clicking something far off from what you meant to click.

Seems to happen very consistently when I have comfyui windows open for a long time. I am not sure if it's because of duration of time open, or perhaps because I minimized and then re-opened the window.

It doesn't do it for me during normal operation after you first start comfyui, so there is some event happening causing this.

I am using Chrome on Windows 10

To fix it: If you click the maximize button on chrome a couple of times, (resizing the browser window size), it resets the cursor position to the correct spot.

So I think it is something to do with ComfyUI losing the correct window size or mouse cursor position.

This also only works on the tab you are on, so if you have multiple comfyui tabs open, you have to resize the browser window for every tab you have open to reset it. So it's not really a "fix".

You can refresh the actual browser page to fix it, but then you often lose what you had on that tab if you have multiple comfyui tabs open. Comfyui will usually reload the last workflow queued if you do this, replacing the one you had in that tab. So this is also not really a "fix"

Restarting the comfyui console window doesn't seem to fix it either - if you go back to the tab you were working on.

Doesn't work: Minimizing and re-opening doesn't fix it, neither does hitting the refresh button on the comfyui menu.

Thanks!

NeedsMoar commented 5 months ago

This sounds like a chrome issue rather than a comfyui one... it never happens in firefox when I accidentally leave the interface open for long periods of time. Try one of the painting tool websites that uses full-window canvas and see if it does the same thing after running for a long time.

Svring commented 4 months ago

same issue on Arc(a relatively new mac browser in case you never heard about it) so this may be comfy's problem rather than browser's or operating system's. In my case reloading comfyui tab could get cursor position correct but also get working process interrupted.

NeedsMoar commented 4 months ago

same issue on Arc(a relatively new mac browser in case you never heard about it) so this may be comfy's problem rather than browser's or operating system's. In my case reloading comfyui tab could get cursor position correct but also get working process interrupted.

Arc is based on Google's Blink web engine (forked from Webkit years ago when they were still working on it with Apple) which drives Chrome / Chromium project browsers. Its javascript engine is V8 which is used by Chrome and all related browsers as well, so there's effectively no difference.

NeedsMoar commented 4 months ago

Anyway I'm not saying comfy shouldn't be compatible with Chrome but that new one trying for form over function is probably worse. I mentioned that I use firefox because it's generally horrible with canvas + mouse issues and outright fails to work with shadertoy.com in the current LTS version... chrome should be more compatible but everybody is using their own branch of the engine and V8 and they're all on different versions. Samsung browser is chrome-based on Android but older than the chrome branch google is using, then MS is using some modified version for edge and uses the javascript engine for VSCode. Firefox has bugs from 20 years ago that haven't been fixed yet because nobody was interested in them or they couldn't repro, and it used to be the more popular of the open source browsers. Chrome has the same problem, with the additional problem of bug reports like this one...

The only OS version mentioned in the thread is "Windows 10". The only browser info are names. There's no info about the version of Comfy. There's no info about installed modules, screen resolution, DPI, scaling, or anything. The only common issue between the two instances is "Chromium" at this point since we've now ruled out GPU, OS, and maybe hardware depending on what mac revision you have. Maybe you both have the same mouse. Who knows.