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

Bookmarks intermittently stop working until a restart. #376

Open
GalaxyTimeMachine opened this issue Nov 20, 2024 · 8 comments
Open

Bookmarks intermittently stop working until a restart. #376

GalaxyTimeMachine opened this issue Nov 20, 2024 · 8 comments

Comments

@GalaxyTimeMachine
Copy link

This has happened over the past couple of days, but I've been using the bookmarks for several hours without any problem. They suddenly stop working, with no errors or obvious reason. I've tried different workflows, reloading the same one, but the only way I can get them working again is to stop/start ComfyUI. The problem seemed to start around the same time as the lora loader add button stopped working, so may be related in some way.

After typing this, I went back to my ComfyUI tab, and they started working again, without a restart!

@LukeG89
Copy link

LukeG89 commented Nov 20, 2024

I think I've had this problem for about a month now, but it has occurred only a few times during this period. I've never been able to figure out the cause. It could be another conflict with the frontend, in this case the keybindings system. But I think it's hard to solve the problem if we can't reproduce it.

@rgthree
Copy link
Owner

rgthree commented Nov 24, 2024

After typing this, I went back to my ComfyUI tab, and they started working again, without a restart!

Sometimes a key gets stuck as "pressed" in the code, usually due to something else taking control before a "released" is fired. To help combat this, I reset all keys to "not currently pressed" when the tab loses and regains focus (as in, "going back to your comfy tab").

Two questions:

  1. What OS and browser are you on?
  2. Can you think of what keyboard actions you would last take that would then cause the bookmarks to stop working? This is usually something that removes control from the window, like a browser or OS key shortcut), but it could be something new in ComfyUI or an extension that is not bubbling an event so rgthree-comfy knows the status).

Explanation: In the browser JavaScript, you can't actually know if a key is "currently pressed" only that it has been pressed and has been released so to track the current state of a key, we need listen to both the pressed and released and consider a key "currently pressed" in between these two states. Unfortunately, in some situations it's not impossible to miss a released resulting in the key continuing to look pressed. Bookmarks work by key combination. So if "ctrl" is "stuck" as pressed even when it's not, and you press "1" the bookmark may not work because it thinks you're pressing "ctrl + 1".

@LukeG89
Copy link

LukeG89 commented Nov 24, 2024

About your questions:

  1. I'm on Windows 11 using Chrome
  2. I can't remember since it happened just a few times

Sometimes a key gets stuck as "pressed" in the code

I think this is the problem, I don't think it's due to a conflict with frontend or other extensions.

So if "ctrl" is "stuck" as pressed even when it's not, and you press "1" the bookmark may not work because it thinks you're pressing "ctrl + 1".

One time I had a problem while trying to change the key in a bookmark: When I pressed the new key, another key + the new key were entered. Now I understand why! Thanks for the explanation!

@GalaxyTimeMachine
Copy link
Author

I was using Windows 11 and Edge browser.

@rgthree
Copy link
Owner

rgthree commented Nov 24, 2024

Hmmm. Wasn't expecting Windows and chrome. To help, I've just added a debug option to show what keys rgthree-comfy thinks is currently down.

If you pull the latest, and add the following to you rgthree_config.json in the rgthree-comfy directory it will put a small label in the top-right of your window showing those current keys.

  "debug": {
    "keys_down": {
      "enabled": true
    }
  }

If you notice bookmarks not working again, check up there and see if some keys are "stuck." If not, something else may be going on and this was just a red herring.

@idesign2018
Copy link

Hmmm. Wasn't expecting Windows and chrome. To help, I've just added a debug option to show what keys rgthree-comfy thinks is currently down.

If you pull the latest, and add the following to you rgthree_config.json in the rgthree-comfy directory it will put a small label in the top-right of your window showing those current keys.

  "debug": {
    "keys_down": {
      "enabled": true
    }
  }

If you notice bookmarks not working again, check up there and see if some keys are "stuck." If not, something else may be going on and this was just a red herring.

I added this code to the rgthree_config.json file in the rgthree-comfy directory, but it still doesn't work

{
  "features": {
    "group_header_fast_toggle": {
      "enabled": true
    },
    "import_individual_nodes": {
      "enabled": true
    },
    "menu_auto_nest": {
      "subdirs": true
    },
    "progress_bar": {
      "height": 16
    },
    "show_alerts_for_corrupt_workflows": true
  },
  
  "debug": {
    "keys_down": {
      "enabled": true
    }
  }
}

@idesign2018
Copy link

When my ComfyUI is in Chinese, the label does not work properly, as shown below:
image

When my ComfyUI is in English, the label works fine, as shown below:
image

This problem seems to have appeared a long time ago.
I am currently using the ComfyUI desktop version.

If I try to switch from the English interface to the Chinese interface, the labels don't work properly.

@idesign2018
Copy link

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

No branches or pull requests

4 participants