Open vaskers5 opened 20 hours ago
working on fix, looks like simple pydantic bug
encountered the same issue
same here. txt2img via api is broken now. img2img works.
Here to report the same issue.
Traceback (most recent call last):
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 396, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 70, in __call__
return await self.app(scope, receive, send)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\fastapi\applications.py", line 1106, in __call__
await super().__call__(scope, receive, send)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\starlette\applications.py", line 122, in __call__
await self.middleware_stack(scope, receive, send)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
raise exc
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\route_utils.py", line 724, in __call__
await self.app(scope, receive, send)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
raise exc
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in __call__
raise e
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in __call__
await self.app(scope, receive, send)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\starlette\routing.py", line 718, in __call__
await route.handle(scope, receive, send)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\starlette\routing.py", line 276, in handle
await self.app(scope, receive, send)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\starlette\routing.py", line 66, in app
response = await func(request)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\fastapi\routing.py", line 292, in app
content = await serialize_response(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\fastapi\routing.py", line 160, in serialize_response return field.serialize(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\fastapi\_compat.py", line 147, in serialize
return self._type_adapter.dump_python(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\type_adapter.py", line 142, in wrapped
return func(self, *args, **kwargs)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\type_adapter.py", line 458, in dump_python
return self.serializer.to_python(
pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'dataclasses._HAS_DEFAULT_FACTORY_CLASS'>
Same issue. (calling the API via typescript client).
https://github.com/lllyasviel/stable-diffusion-webui-forge/pull/2138
I fixed it here, just a simple bug
Similar issue when call from web:
ERROR: Exception in ASGI application████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00, 6.52it/s] Traceback (most recent call last): File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call return await self.app(scope, receive, send) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\fastapi\applications.py", line 1106, in call await super().call(scope, receive, send) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\starlette\applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\starlette\middleware\errors.py", line 184, in call raise exc File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\starlette\middleware\errors.py", line 162, in call await self.app(scope, receive, _send) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\gradio\route_utils.py", line 730, in call await self.simple_response(scope, receive, send, request_headers=headers) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\gradio\route_utils.py", line 746, in simple_response await self.app(scope, receive, send) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\starlette\middleware\exceptions.py", line 79, in call raise exc File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\starlette\middleware\exceptions.py", line 68, in call await self.app(scope, receive, sender) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in call raise e File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in call await self.app(scope, receive, send) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\starlette\routing.py", line 718, in call await route.handle(scope, receive, send) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\starlette\routing.py", line 276, in handle await self.app(scope, receive, send) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\starlette\routing.py", line 66, in app response = await func(request) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\fastapi\routing.py", line 292, in app content = await serialize_response( File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\fastapi\routing.py", line 160, in serialize_response return field.serialize( File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\fastapi_compat.py", line 147, in serialize return self._type_adapter.dump_python( File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\pydantic\type_adapter.py", line 142, in wrapped return func(self, *args, **kwargs) File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\pydantic\type_adapter.py", line 458, in dump_python return self.serializer.to_python( pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'dataclasses._HAS_DEFAULT_FACTORY_CLASS'>
2138
I fixed it here, just a simple bug
doesn't work for me. results in:
"
File "E:\ai_gh_repos\webui_forge_cu121_torch231_EXP\webui\modules\api\api.py", line 475, in text2imgapi
with closing(StableDiffusionProcessingTxt2Img(sd_model=shared.sd_model, **args)) as p:
File "
I'm not sure but is not connected with pydantic
2138
I fixed it here, just a simple bug
doesn't work for me. results in: " File "E:\ai_gh_repos\webui_forge_cu121_torch231_EXP\webui\modules\api\api.py", line 475, in text2imgapi with closing(StableDiffusionProcessingTxt2Img(sd_model=shared.sd_model, args)) as p: File "", line 58, in init** TypeError: 'NoneType' object is not callable "
Here is code example:
here is error log:
`{ "name": "JSONDecodeError", "message": "Expecting value: line 1 column 1 (char 0)", "stack": "--------------------------------------------------------------------------- JSONDecodeError Traceback (most recent call last) File ~/anaconda3/envs/work/lib/python3.10/site-packages/requests/models.py:974, in Response.json(self, kwargs) 973 try: --> 974 return complexjson.loads(self.text, kwargs) 975 except JSONDecodeError as e: 976 # Catch JSON-related errors and raise as requests.JSONDecodeError 977 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
File ~/anaconda3/envs/work/lib/python3.10/json/init.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 343 if (cls is None and object_hook is None and 344 parse_int is None and parse_float is None and 345 parse_constant is None and object_pairs_hook is None and not kw): --> 346 return _default_decoder.decode(s) 347 if cls is None:
File ~/anaconda3/envs/work/lib/python3.10/json/decoder.py:337, in JSONDecoder.decode(self, s, _w) 333 \"\"\"Return the Python representation of
s
(astr
instance 334 containing a JSON document). 335 336 \"\"\" --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end()File ~/anaconda3/envs/work/lib/python3.10/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError(\"Expecting value\", s, err.value) from None 356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
JSONDecodeError Traceback (most recent call last) Cell In[7], line 14 7 gen_conf_1['override_settings']['sd_model_checkpoint'] = 'colorfulxl_v70' 9 response = requests.post( 10 url=url, 11 headers={\"accept\": \"application/json\"}, 12 json=gen_conf, 13 ) ---> 14 img = response.json()[\"images\"][0].split(\",\", 1)[0] 16 # Decode the base64 string 17 img_data = base64.b64decode(img)
File ~/anaconda3/envs/work/lib/python3.10/site-packages/requests/models.py:978, in Response.json(self, kwargs) 974 return complexjson.loads(self.text, kwargs) 975 except JSONDecodeError as e: 976 # Catch JSON-related errors and raise as requests.JSONDecodeError 977 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError --> 978 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
JSONDecodeError: Expecting value: line 1 column 1 (char 0)" } `