Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: save_pil_to_file() got an unexpected keyword argument 'format' #120

Closed
777777lkj opened this issue Jul 5, 2023 · 4 comments
Closed

Comments

@777777lkj
Copy link

This issue occurred when updating to the latest version

To create a public link, set share=True in launch().
Startup time: 11.2s (import torch: 1.0s, import gradio: 0.7s, import ldm: 0.3s, other imports: 0.6s, load scripts: 3.3s, create ui: 2.9s, gradio launch: 2.4s).
number of faces: 1
prompt for the face: <lora:face (1):1>
Traceback (most recent call last):
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\blocks.py", line 1326, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\components.py", line 4457, in postprocess
file = self.img_array_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR)
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\components.py", line 355, in img_array_to_temp_file
return self.pil_to_temp_file(pil_image, dir, format="png")
TypeError: save_pil_to_file() got an unexpected keyword argument 'format'
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。
number of faces: 1
prompt for the face: <lora:face (1):1>
Traceback (most recent call last):
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\routes.py", line 422, in run_predict
event_id = getattr(body, "event_id", None)
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\blocks.py", line 1326, in process_api
):
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data
output = []
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\components.py", line 4457, in postprocess
File "D:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\components.py", line 355, in img_array_to_temp_file
TypeError: save_pil_to_file() got an unexpected keyword argument 'format'
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

@ototadana
Copy link
Owner

@777777lkj
Thanks for the error report.

I have never seen this error before, so at this point I cannot imagine either the cause or the solution.

If there is a case where the error does not occur, could you please tell me the difference in settings and environment from that case? If you can give me that information, I may be able to reproduce the phenomenon and determine the cause from that information.

@iamrohitanshu
Copy link
Contributor

@ototadana I'm not entirely sure, but I think this problem is not with this extension, but the webui instead.
Many other extensions have the same issue.
For example, you might wanna check out opparco/stable-diffusion-webui-two-shot#54 (comment)

@ototadana
Copy link
Owner

ototadana commented Jul 6, 2023

@iamrohitanshu
Thanks!
Just now I was looking at that too.

The cause seems to be that the save_pil_to_file method overridden by SD Web UI (-1.3.2) does not match the arguments required by gradio.

However, the latest version of the Web UI (1.4.0) has the following fixes and should work fine.

I am not sure why this problem is occurring. It may be a distribution-specific problem that does not occur with the original Web UI.

@777777lkj @player99963
If your Web UI version is not 1.4.0, please try upgrading. I think there is a good chance that this problem can be solved.

@player99963
Copy link

If your Web UI version is not 1.4.0, please try upgrading. I think there is a good chance that this problem can be solved.

After testing, the problems have all been solved.
Thank you for your efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants