mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-12-03 20:48:37 +07:00
[GH-ISSUE #299] [Bug] Exception in ASGI application #259
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Physton/sd-webui-prompt-all-in-one#259
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hben35096 on GitHub (Feb 12, 2024).
Original GitHub issue: https://github.com/Physton/sd-webui-prompt-all-in-one/issues/299
Issue Feedback
Describe the Issue
I have installed the 'all-in-one' plugin in stable-diffusion-webui-forge.
https://github.com/lllyasviel/stable-diffusion-webui-forge
The 'all-in-one' plugin can be used normally, but every time:
1.Press Enter after entering text in the input box;
2.Manually input English in the prompt and then click the 'Generate Image' button for the first time.
The following prompt appears:
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 412, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/root/miniconda3/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
File "/root/miniconda3/lib/python3.10/site-packages/fastapi/applications.py", line 273, in call
await super().call(scope, receive, send)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/root/miniconda3/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/middleware/cors.py", line 92, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/middleware/cors.py", line 147, in simple_response
await self.app(scope, receive, send)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in call
await responder(scope, receive, send)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in call
await self.app(scope, receive, self.send_with_gzip)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/root/miniconda3/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/root/miniconda3/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call
raise e
File "/root/miniconda3/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/root/miniconda3/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/root/miniconda3/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
raw_response = await run_endpoint_function(
File "/root/miniconda3/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
return await dependant.call(**values)
File "/root/stable-diffusion-webui-forge/extensions/sd-webui-prompt-all-in-one/scripts/on_app_started.py", line 108, in _token_counter
return get_token_counter(data['text'], data['steps'])
File "/root/stable-diffusion-webui-forge/extensions/sd-webui-prompt-all-in-one/scripts/physton_prompt/get_token_counter.py", line 21, in get_token_counter
token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts],
File "/root/stable-diffusion-webui-forge/extensions/sd-webui-prompt-all-in-one/scripts/physton_prompt/get_token_counter.py", line 21, in
token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts],
TypeError: StableDiffusionModelHijack.get_prompt_lengths() missing 1 required positional argument: 'cond_stage_model'
To load target model BaseModel
Begin to load 1 model
Moving model(s) has taken 0.43 seconds
0%| | 0/20 [00:00<?, ?it/s]
5%|██▏ | 1/20 [00:00<00:10, 1.82it/s]
25%|███████████ | 5/20 [00:00<00:01, 8.27it/s]
35%|███████████████▍ | 7/20 [00:00<00:01, 10.76it/s]
45%|███████████████████▊ | 9/20 [00:01<00:00, 12.71it/s]
55%|███████████████████████▋ | 11/20 [00:01<00:00, 14.21it/s]
65%|███████████████████████████▉ | 13/20 [00:01<00:00, 15.34it/s]
75%|████████████████████████████████▎ | 15/20 [00:01<00:00, 15.83it/s]
85%|████████████████████████████████████▌ | 17/20 [00:01<00:00, 15.69it/s]
100%|███████████████████████████████████████████| 20/20 [00:01<00:00, 12.19it/s]
To load target model AutoencoderKL
Begin to load 1 model
Total progress: 100%|███████████████████████████| 20/20 [00:01<00:00, 14.05it/s]
Steps to Reproduce
No response
Screenshot or log
No response
OS
Ubuntu
Browser
Edge
Stable Diffusion WebUI version
No response
Extension version
No response
Python version
No response
Gradio version
No response
@Physton commented on GitHub (Feb 13, 2024):
Thank you for your feedback, I will fix this issue in the future.
@Physton commented on GitHub (Feb 14, 2024):
Thanks to the developer @serick4126 for helping with the fix.
@hben35096 commented on GitHub (Feb 14, 2024):
@serick4126
Thank you very much, the problem was solved perfectly.
@Mohsyn commented on GitHub (Apr 12, 2024):
I have the same issue on version: f0.0.17v1.8.0rc-latest-282-g29be1da • python: 3.10.6 • torch: 2.1.2+cu121 • xformers: N/A • gradio: 3.41.2
@Physton commented on GitHub (Apr 12, 2024):
Backup the "storage" directory, then delete the "storage" directory, and try restarting.
@Mohsyn commented on GitHub (Apr 13, 2024):
Deleted storage directory and restarted, error still persists.
this is the log
ERROR: Exception in ASGI application████████████████████████████████████████████████| 22/22 [00:23<00:00, 1.10s/it] Traceback (most recent call last): File "c:\forge\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 "c:\forge\system\python\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__ return await self.app(scope, receive, send) File "c:\forge\system\python\lib\site-packages\fastapi\applications.py", line 273, in __call__ await super().__call__(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\applications.py", line 122, in __call__ await self.middleware_stack(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__ raise exc File "c:\forge\system\python\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "c:\forge\system\python\lib\site-packages\starlette\middleware\cors.py", line 92, in __call__ await self.simple_response(scope, receive, send, request_headers=headers) File "c:\forge\system\python\lib\site-packages\starlette\middleware\cors.py", line 147, in simple_response await self.app(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__ await responder(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__ await self.app(scope, receive, self.send_with_gzip) File "c:\forge\system\python\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__ raise exc File "c:\forge\system\python\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__ await self.app(scope, receive, sender) File "c:\forge\system\python\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__ raise e File "c:\forge\system\python\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\routing.py", line 718, in __call__ await route.handle(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\routing.py", line 276, in handle await self.app(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\routing.py", line 66, in app response = await func(request) File "c:\forge\system\python\lib\site-packages\fastapi\routing.py", line 237, in app raw_response = await run_endpoint_function( File "c:\forge\system\python\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function return await dependant.call(**values) File "C:\forge\webui\extensions\sd-webui-prompt-all-in-one\scripts\on_app_started.py", line 108, in _token_counter return get_token_counter(data['text'], data['steps']) File "C:\forge\webui\extensions\sd-webui-prompt-all-in-one\scripts\physton_prompt\get_token_counter.py", line 21, in get_token_counter token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts], File "C:\forge\webui\extensions\sd-webui-prompt-all-in-one\scripts\physton_prompt\get_token_counter.py", line 21, in <listcomp> token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts], TypeError: StableDiffusionModelHijack.get_prompt_lengths() missing 1 required positional argument: 'cond_stage_model' ERROR: Exception in ASGI application Traceback (most recent call last): File "c:\forge\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 "c:\forge\system\python\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__ return await self.app(scope, receive, send) File "c:\forge\system\python\lib\site-packages\fastapi\applications.py", line 273, in __call__ await super().__call__(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\applications.py", line 122, in __call__ await self.middleware_stack(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__ raise exc File "c:\forge\system\python\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "c:\forge\system\python\lib\site-packages\starlette\middleware\cors.py", line 92, in __call__ await self.simple_response(scope, receive, send, request_headers=headers) File "c:\forge\system\python\lib\site-packages\starlette\middleware\cors.py", line 147, in simple_response await self.app(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__ await responder(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__ await self.app(scope, receive, self.send_with_gzip) File "c:\forge\system\python\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__ raise exc File "c:\forge\system\python\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__ await self.app(scope, receive, sender) File "c:\forge\system\python\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__ raise e File "c:\forge\system\python\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\routing.py", line 718, in __call__ await route.handle(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\routing.py", line 276, in handle await self.app(scope, receive, send) File "c:\forge\system\python\lib\site-packages\starlette\routing.py", line 66, in app response = await func(request) File "c:\forge\system\python\lib\site-packages\fastapi\routing.py", line 237, in app raw_response = await run_endpoint_function( File "c:\forge\system\python\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function return await dependant.call(**values) File "C:\forge\webui\extensions\sd-webui-prompt-all-in-one\scripts\on_app_started.py", line 108, in _token_counter return get_token_counter(data['text'], data['steps']) File "C:\forge\webui\extensions\sd-webui-prompt-all-in-one\scripts\physton_prompt\get_token_counter.py", line 21, in get_token_counter token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts], File "C:\forge\webui\extensions\sd-webui-prompt-all-in-one\scripts\physton_prompt\get_token_counter.py", line 21, in <listcomp> token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts], TypeError: StableDiffusionModelHijack.get_prompt_lengths() missing 1 required positional argument: 'cond_stage_model'@Mohsyn commented on GitHub (Apr 20, 2024):
should i make a new bug report ?
@serick4126 commented on GitHub (Apr 23, 2024):
@Mohsyn
In your error log you have included the following error
File "C:\forge\webui\extensions\sd-webui-prompt-all-in-one\scripts\physton_prompt\get_token_counter.py", line 21, in get_token_counter token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts],)The code that calculates the token_count in line 21 of get_token_counter.py is the code before I made the modifications to https://github.com/Physton/sd-webui-prompt-all-in-one/pull/301
Please update your extension as I believe you are using outdated code.
@Mohsyn commented on GitHub (Apr 24, 2024):
Extension showed updated in both Manager and using Git
However I removed the extension completely and reinstalled.
I have not seen the error yet.
Thanks for your help!