zero01101 / openOutpaint-webUI-extension

direct A1111 webUI extension for openOutpaint
MIT License
397 stars 22 forks source link

[Bug]: Latest Automatic update breaks openOutpaint #31

Closed vladmandic closed 1 year ago

vladmandic commented 1 year ago

Is ths issue about the extension?

What happened?

Updated Automatic1111 to latest (hash #6faae2323963f9b0e0086a85b9d0472a24fbaa73) openOutpaint Extension stops working:

pydantic.error_wrappers.ValidationError: 1 validation error for Options
response -> show_progressbar
  value is not None (type=type_error.not_none)
ERROR:    Exception in ASGI application

basically, options object now has one more mandatory field show_progressbar that openOutpaint is not sending via POST, so its raising validation errors.

Steps to reproduce the problem

### What should have happened? ### Commit where the problem happens 201456ce36f2f6ec81067003199c4d77d4c57fbf ### What platforms do you use to access openOutpaint? Windows ### What browsers do you use to access the UI ? Microsoft Edge ### Browser Extensions/Addons N/A ### AUTOMATIC1111 webUI Commandline Arguments --api --xformers ### Additional information _No response_
seijihariki commented 1 year ago

Hi! I could not really replicate the error you are describing. From what I understand, we never have to actually send anything to options, and only POST to it for changing the model and for setting color correction and mask weight on boot if the user accepts it.

There was actually another problem (unrelated to show_progressbar), but seems to have been fixed by a966a1e706e9c4d65bdb63789d257626af2d6e77.

Are your problems still happening?

zero01101 commented 1 year ago

hah, yeah, i saw this bug report this morning, gave it a few cursory wtfs, gave it several more louder wtfs over lunch, and failed to explain myself lol

sooo as mentioned, we don't POST to options until we try and switch models, and even doing that from the standalone app was working just fine; i never got the mentioned issue about the show_progressbar param at all, nor do i receive anything about pydantic anywhere, so maybe that's... a different extension's bug? however yeah, confirmed openOutpaint extension was BROKEN and i constantly got the following garbage along with 500 server errors in console:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 152, in jsonable_encoder
    data = dict(obj)
TypeError: 'coroutine' object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 157, in jsonable_encoder
    data = vars(obj)
TypeError: vars() argument must have __dict__ attribute

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "E:\storage\webui-clean\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 106, in __call__
    response = await self.dispatch_func(request, call_next)
  File "E:\storage\webui-clean\modules\api\api.py", line 80, in log_and_time
    res: Response = await call_next(req)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 80, in call_next
    raise app_exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 69, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\routing.py", line 255, in app
    content = await serialize_response(
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\routing.py", line 152, in serialize_response
    return jsonable_encoder(response_content)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 160, in jsonable_encoder
    raise ValueError(errors) from e
ValueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 152, in jsonable_encoder
    data = dict(obj)
TypeError: 'coroutine' object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 157, in jsonable_encoder
    data = vars(obj)
TypeError: vars() argument must have __dict__ attribute

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "E:\storage\webui-clean\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 106, in __call__
    response = await self.dispatch_func(request, call_next)
  File "E:\storage\webui-clean\modules\api\api.py", line 80, in log_and_time
    res: Response = await call_next(req)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 80, in call_next
    raise app_exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 69, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\routing.py", line 255, in app
    content = await serialize_response(
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\routing.py", line 152, in serialize_response
    return jsonable_encoder(response_content)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 160, in jsonable_encoder
    raise ValueError(errors) from e
ValueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 152, in jsonable_encoder
    data = dict(obj)
TypeError: 'coroutine' object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 157, in jsonable_encoder
    data = vars(obj)
TypeError: vars() argument must have __dict__ attribute

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\storage\webui-clean\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "E:\storage\webui-clean\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 106, in __call__
    response = await self.dispatch_func(request, call_next)
  File "E:\storage\webui-clean\modules\api\api.py", line 80, in log_and_time
    res: Response = await call_next(req)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 80, in call_next
    raise app_exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\base.py", line 69, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "E:\storage\webui-clean\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\routing.py", line 255, in app
    content = await serialize_response(
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\routing.py", line 152, in serialize_response
    return jsonable_encoder(response_content)
  File "E:\storage\webui-clean\venv\lib\site-packages\fastapi\encoders.py", line 160, in jsonable_encoder
    raise ValueError(errors) from e
ValueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]E:\storage\webui-clean\venv\lib\site-packages\starlette\datastructures.py:527: RuntimeWarning: coroutine 'App.create_app.<locals>.file' was never awaited
  self._list = scope["headers"] = list(scope["headers"])
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
E:\storage\webui-clean\venv\lib\site-packages\anyio\_backends\_asyncio.py:864: RuntimeWarning: coroutine 'App.create_app.<locals>.file' was never awaited
  result = None
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

this was destroying my enfeebled mind rather extensively because i couldn't find anything different in A1111's recent commits that'd do anything with API or asyncio, so it HAD to be the gradio version bump, right? well nothing in gradio changelogs either, but dropping back to commit https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/d8f8bcb821fa62e943eb95ee05b8a949317326fe did bring back openOutpaint extension... just as a sanity check, i made a teeny little stupid test extension that just had an iframe to the github.io openOutpaint page and that didn't "work" because of CORS etc but it at least rendered without absolutely panicking, so i changed it to point at the (copied) submodule folder a la this extension does, and bam instantly broken... breakthrough came when i remembered this thread and decided to open a txt2img output in a new tab... turns out file/ which used to work now must be file= in URIs

lil bad pokerface

so yeah, i THINK the 500 issue from openOutpaint extension should be fixed now?

vladmandic commented 1 year ago

confirm as working now.

btw, there is a minor issue where "send to openoutpaint" button doesnt automatically switch tabs anymore
(image does get transferred, so it more cosmetic than functiona issue)

zero01101 commented 1 year ago

send to openOutpaint buttons should be fixed as of https://github.com/zero01101/openOutpaint-webUI-extension/commit/3ebc1812ecdfd3578852dfb09532ddc53a3728a2