davehornik / sd-discord-rich_presence

Discord Rich Presence for AUTOMATIC1111's Stable Diffusion WebUI
GNU Affero General Public License v3.0
21 stars 3 forks source link

Error executing callback ui_tabs_callback #11

Open TheKfcBandit opened 1 year ago

TheKfcBandit commented 1 year ago

Error

*** Error executing callback ui_tabs_callback for C:\stable-diffusion-webui\extensions\sd-discord-rich_presence\scripts\main.py Traceback (most recent call last): File "C:\stable-diffusion-webui\modules\script_callbacks.py", line 153, in ui_tabs_callback res += c.callback() or [] File "C:\stable-diffusion-webui\extensions\sd-discord-rich_presence\scripts\main.py", line 138, in on_ui_tabs discord_broadcast() File "C:\stable-diffusion-webui\extensions\sd-discord-rich_presence\scripts\main.py", line 25, in discord_broadcast broadcast.connect() File "C:\stable-diffusion-webui\venv\lib\site-packages\pypresence\presence.py", line 43, in connect self.loop.run_until_complete(self.handshake()) File "C:\Users\bandit\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "C:\stable-diffusion-webui\venv\lib\site-packages\pypresence\baseclient.py", line 116, in handshake self.sockwriter, = await asyncio.wait_for(self.loop.create_pipe_connection(lambda: reader_protocol, ipc_path), self.connection_timeout) AttributeError: '_WindowsSelectorEventLoop' object has no attribute 'create_pipe_connection'

Edesak commented 1 year ago

I will look at this problem asap. But be patient with it please.

art3mskiy commented 1 year ago

Got same error with python 3.10.9 Same with 3.10.6

marduk191 commented 1 year ago

Same problem started yesterday Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] Version: v1.4.0-2-g8d0078b6 Commit hash: 8d0078b6ef280f43efd7cccc2ea673dccdd1c0aa

*** Error executing callback ui_tabs_callback for G:\AI\stable-diffusion-webui\extensions\discord-rpc-for-automatic1111-webui\scripts\webui-rpc.py Traceback (most recent call last): File "G:\AI\stable-diffusion-webui\modules\script_callbacks.py", line 153, in ui_tabs_callback res += c.callback() or [] File "G:\AI\stable-diffusion-webui\extensions\discord-rpc-for-automatic1111-webui\scripts\webui-rpc.py", line 34, in on_ui_tabs start_rpc() File "G:\AI\stable-diffusion-webui\extensions\discord-rpc-for-automatic1111-webui\scripts\webui-rpc.py", line 27, in start_rpc rpc.connect() File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\pypresence\presence.py", line 43, in connect self.loop.run_until_complete(self.handshake()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\pypresence\baseclient.py", line 116, in handshake self.sockwriter, = await asyncio.wait_for(self.loop.create_pipe_connection(lambda: reader_protocol, ipc_path), self.connection_timeout) AttributeError: '_WindowsSelectorEventLoop' object has no attribute 'create_pipe_connection'


marduk191 commented 1 year ago

I'm pretty sure it's upstream because of this issue.

Launching Web UI with arguments: --medvram --use-cpu interrogate --api Traceback (most recent call last): File "G:\AI\stable-diffusion-webui\launch.py", line 38, in main() File "G:\AI\stable-diffusion-webui\launch.py", line 34, in main start() File "G:\AI\stable-diffusion-webui\modules\launch_utils.py", line 340, in start import webui File "G:\AI\stable-diffusion-webui\webui.py", line 28, in import pytorch_lightning # noqa: F401 # pytorch_lightning should be imported after torch, but it re-enables warnings on import so import once to disable them File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning__init.py", line 35, in from pytorch_lightning.callbacks import Callback # noqa: E402 File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks__init.py", line 14, in from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks\batch_size_finder.py", line 24, in from pytorch_lightning.callbacks.callback import Callback File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks\callback.py", line 25, in from pytorch_lightning.utilities.types import STEP_OUTPUT File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\utilities\types.py", line 27, in from torchmetrics import Metric File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\torchmetrics__init.py", line 14, in from torchmetrics import functional # noqa: E402 File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\functional\init.py", line 121, in from torchmetrics.functional.text._deprecated import _bleu_score as bleu_score File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\functional\text\init__.py", line 31, in from torchmetrics.functional.text.bert import bert_score File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\functional\text\bert.py", line 25, in from torchmetrics.functional.text.helper_embedding_metric import ( File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\functional\text\helper_embedding_metric.py", line 27, in from transformers import AutoModelForMaskedLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizerBase File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\transformers\init__.py", line 30, in from . import dependency_versions_check File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\transformers\dependency_versions_check.py", line 17, in from .utils.versions import require_version, require_version_core File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\transformers\utils\init.py", line 34, in from .generic import ( File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\transformers\utils\generic.py", line 29, in from .import_utils import is_flax_available, is_tf_available, is_torch_available, is_torch_fx_proxy File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\transformers\utils\import_utils.py", line 34, in from . import logging File "G:\AI\stable-diffusion-webui\venv\lib\site-packages\transformers\utils\logging.py", line 31, in from tqdm import auto as tqdm_lib ImportError: cannot import name 'auto' from 'tqdm' (G:\AI\stable-diffusion-webui\venv\lib\site-packages\tqdm\init__.py

hubrockman commented 11 months ago

hi guys

[Discord Rich Presence] Discord Rich Presence Extension, version 1.3.1 [Discord Rich Presence] Bug reporting -> https://github.com/davehornik/sd-discord-rich_presence Error executing callback ui_tabs_callback for D:\SD\stable-diffusion-webui\extensions\sd-discord-rich_presence\scripts\main.py Traceback (most recent call last): File "D:\SD\stable-diffusion-webui\modules\script_callbacks.py", line 134, in ui_tabs_callback res += c.callback() or [] File "D:\SD\stable-diffusion-webui\extensions\sd-discord-rich_presence\scripts\main.py", line 138, in on_ui_tabs discord_broadcast() File "D:\SD\stable-diffusion-webui\extensions\sd-discord-rich_presence\scripts\main.py", line 25, in discord_broadcast broadcast.connect() File "D:\SD\stable-diffusion-webui\venv\lib\site-packages\pypresence\presence.py", line 43, in connect self.loop.run_until_complete(self.handshake()) File "D:\Python\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "D:\SD\stable-diffusion-webui\venv\lib\site-packages\pypresence\baseclient.py", line 116, in handshake self.sockwriter, = await asyncio.wait_for(self.loop.create_pipe_connection(lambda: reader_protocol, ipc_path), self.connection_timeout) AttributeError: '_WindowsSelectorEventLoop' object has no attribute 'create_pipe_connection'

davehornik commented 11 months ago

Will look into that why it's causing issue for you guys. But since I am heavily busy with my work, and my co-author is also busy for next 5 days, it can take a while.

hubrockman commented 11 months ago

of course I understand bro, I know how Github works and this is something like volunteering, in any case the only thing I can do is report the errors I have so you can figure out what the hell it is, anyway I'll be on the lookout for the next one build, thanks for your time

elpuertorro commented 10 months ago

Just came in to report recent fresh install with all dependancies, making sure all is in place and get the same error:

[Discord Rich Presence] Discord Rich Presence Extension, version 1.3.1 [Discord Rich Presence] Bug reporting -> https://github.com/davehornik/sd-discord-rich_presence Creating model from config: D:\Desktop\stable-diffusion-webui-directml\repositories\generative-models\configs\inference\sd_xl_base.yaml Loading VAE weights specified in settings: D:\Desktop\stable-diffusion-webui-directml\models\VAE\sdxl_vae.safetensors Applying attention optimization: Doggettx... done. Model loaded in 3.7s (load weights from disk: 0.6s, create model: 0.4s, apply weights to model: 1.2s, load VAE: 0.2s, calculate empty prompt: 1.3s). *** Error executing callback ui_tabs_callback for D:\Desktop\stable-diffusion-webui-directml\extensions\sd-discord-rich_presence\scripts\main.py Traceback (most recent call last): File "D:\Desktop\stable-diffusion-webui-directml\modules\script_callbacks.py", line 153, in ui_tabs_callback res += c.callback() or [] File "D:\Desktop\stable-diffusion-webui-directml\extensions\sd-discord-rich_presence\scripts\main.py", line 138, in on_ui_tabs discord_broadcast() File "D:\Desktop\stable-diffusion-webui-directml\extensions\sd-discord-rich_presence\scripts\main.py", line 25, in discord_broadcast broadcast.connect() File "D:\Desktop\stable-diffusion-webui-directml\venv\lib\site-packages\pypresence\presence.py", line 43, in connect self.loop.run_until_complete(self.handshake()) File "C:\Users\Lefty\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "D:\Desktop\stable-diffusion-webui-directml\venv\lib\site-packages\pypresence\baseclient.py", line 116, in handshake self.sockwriter, = await asyncio.wait_for(self.loop.create_pipe_connection(lambda: reader_protocol, ipc_path), self.connection_timeout) AttributeError: '_WindowsSelectorEventLoop' object has no attribute 'create_pipe_connection'

Not sure if related but fyi AMD Gpu user.

TheKfcBandit commented 10 months ago

still broken

elpuertorro commented 10 months ago

Any updates on the issue?

KIZILANDO commented 9 months ago

I think I found the problem I just added this line at the very beginning of the main.py file: asyncio.set_event_loop_policy(WindowsProactorEventLoopPolicy()) by doing of course import asyncio and from asyncio import WindowsProactorEventLoopPolicy and it worked !

marduk191 commented 9 months ago

https://github.com/davehornik/sd-discord-rich_presence/pull/13/commits/9c6a74c4947555e07a27cee023e8f9a5d82cce01 fixes this on the current master branch. Thanks for the push