sdwebui-w-horde / sd-webui-stable-horde-worker

Stable Horde Unofficial Worker Bridge as Stable Diffusion WebUI (AUTOMATIC1111) Extension
GNU Affero General Public License v3.0
60 stars 19 forks source link

Fixed AttributeError: module 'gradio.utils' has no attribute 'synchro… #96

Closed jmsether closed 1 year ago

jmsether commented 1 year ago

Fixed AttributeError: module 'gradio.utils' has no attribute 'synchronize_async'

Description

Fixed [Bug]: #95. The newest gradio library seems to have removed synchronize_async. This can be fixed by importing the 'asyncio' library, and running the 'horde.run()' asynchronous function using the 'run_until_complete' method of the event loop.

Type of changes

Please check the following items before submitting your pull request

MaikoTan commented 1 year ago

Thanks for the PR! I would do a quick test locally and then merge your branch.

By the way, I have tried the asyncio.get_event_loop() before, but it sometimes throws errors that said There is no event loop or something. I am not familiar with Python or Gradio, so I finally end up with the synchronize_async approach. 😿

jmsether commented 1 year ago

@MaikoTan I ran it a few times and I have not had a problem with it yet. I will investigate that further and if I see an issue pop up with it I can easily get that fixed. It looks as though it's accessing a singleton. As long as gradio starts the event loop it should always work.