解决 TypeError: save_pil_to_file()
在使用Stable Diffusion时,您可能会遇到使用SadTalker插件时出现的报错问题。其中,常见的报错是TypeError: save_pil_to_file() got an unexpected keyword argument ‘format’文章来源:https://www.toymoban.com/news/detail-542292.html
报错如下:
File "D:\<mypath>\venv\Lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\<mypath>\venv\Lib\site-packages\gradio\blocks.py", line 1321, in process_api
inputs = self.preprocess_data(fn_index, inputs, state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\<mypath>\venv\Lib\site-packages\gradio\blocks.py", line 1171, in preprocess_data
processed_input.append(block.preprocess(inputs[i]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\<mypath>\venv\Lib\site-packages\gradio\components.py", line 1848, in preprocess
return self._format_image(im)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\<mypath>\venv\Lib\site-packages\gradio\components.py", line 1796, in _format_image
path = self.pil_to_temp_file(
^^^^^^^^^^^^^^^^^^^^^^
TypeError: save_pil_to_file() got an unexpected keyword argument 'format'```
解决方法:
1、在Stable Diffusion安装目录下,找到 requirements_versions.txt文件
2、替换 gradio 的版本为 gradio==3.31.0
3、当启动Stable Diffusion时,它会自动下载并安装3.31.0版本的gradio。文章来源地址https://www.toymoban.com/news/detail-542292.html
到了这里,关于解决 TypeError: save_pil_to_file(stable diffusion使用sadtalker 插件)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!