Stable Diffusion运行Deforum报错问题解决

[复制链接]
查看591 | 回复0 | 2023-8-9 10:06:09 | 显示全部楼层 |阅读模式
运行Deforum时,需要在线下载dpt_large-midas-2f21e586.pt
  1. Downloading: "https://github.com/intel-isl/DPT/releases/download/1_0/dpt_large-midas-2f21e586.pt" to C:\sd-webui-aki\sd-webui-aki-v4.1\models\Deforum\dpt_large-midas-2f21e586.pt
复制代码
可能会遇到报错信息Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \.
  1. *START OF TRACEBACK*
  2. Traceback (most recent call last):
  3.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\run_deforum.py", line 78, in run_deforum
  4.     render_animation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root)
  5.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\render.py", line 109, in render_animation
  6.     depth_model = DepthModel(root.models_path, device, root.half_precision, keep_in_vram=keep_in_vram, depth_algorithm=anim_args.depth_algorithm, Width=args.W, Height=args.H,
  7.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\depth.py", line 32, in __new__
  8.     cls._instance._initialize(models_path=args[0], device=args[1], half_precision=not cmd_opts.no_half, keep_in_vram=keep_in_vram, depth_algorithm=depth_algorithm, Width=Width, Height=Height, midas_weight=midas_weight)
  9.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\depth.py", line 48, in _initialize
  10.     self._initialize_model()
  11.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\depth.py", line 63, in _initialize_model
  12.     self.midas_depth = MidasDepth(self.models_path, self.device, half_precision=self.half_precision, midas_model_type=self.depth_algorithm)
  13.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\depth_midas.py", line 33, in __init__
  14. *END OF TRACEBACK*
  15.     download_file_with_checksum(url=self.midas_model_url, expected_checksum=self.midas_model_checksum, dest_folder=models_path, dest_filename=self.midas_model_filename)
  16.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\general_utils.py", line 128, in download_file_with_checksum
  17.     raise Exception(f"Error while downloading {dest_filename}.]nPlease manually download from: {url}\nAnd place it in: {dest_folder}")
  18. User friendly error message:
  19. Exception: Error while downloading dpt_large-midas-2f21e586.pt.]nPlease manually download from: https://github.com/intel-isl/DPT/releases/download/1_0/dpt_large-midas-2f21e586.pt
  20. 提示:Python 运行时抛出了一个异常。请检查疑难解答页面。
  21. And place it in: C:\sd-webui-aki\sd-webui-aki-v4.1\models/Deforum
  22. Error: Error while downloading dpt_large-midas-2f21e586.pt.]nPlease manually download from: https://github.com/intel-isl/DPT/releases/download/1_0/dpt_large-midas-2f21e586.pt
  23. And place it in: C:\sd-webui-aki\sd-webui-aki-v4.1\models/Deforum. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \.
复制代码
根据log提示,修改C:\sd-webui-aki\sd-webui-aki-v4.1\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers目录下的general_utils.py文件最后的download_file_with_checksum(url, expected_checksum, dest_folder, dest_filename)方法,添加replace替换操作。
  1. def download_file_with_checksum(url, expected_checksum, dest_folder, dest_filename):
  2.     dest_folder=dest_folder.replace("\", "/")
  3.     expected_full_path = os.path.join(dest_folder, dest_filename)
  4.     expected_full_path=expected_full_path.replace("\", "/")
  5.     if not os.path.exists(expected_full_path) and not os.path.isdir(expected_full_path):
  6.         load_file_from_url(url=url, model_dir=dest_folder, file_name=dest_filename, progress=True)
  7.         if checksum(expected_full_path) != expected_checksum:
  8.             raise Exception(f"Error while downloading {dest_filename}.]nPlease manually download from: {url}\nAnd place it in: {dest_folder}")
复制代码
然后重新运行sd-webui,若报错
  1. Loading MiDaS model from dpt_large-midas-2f21e586.pt...
  2. Error verifying pickled file from C:\sd-webui-aki\sd-webui-aki-v4.1\models/Deforum\dpt_large-midas-2f21e586.pt:
  3. Traceback (most recent call last):
  4.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\modules\safe.py", line 82, in check_pt
  5.     with zipfile.ZipFile(filename) as z:
  6.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\python\lib\zipfile.py", line 1269, in __init__
  7.     self._RealGetContents()
  8.   File "C:\sd-webui-aki\sd-webui-aki-v4.1\python\lib\zipfile.py", line 1336, in _RealGetContents
  9.     raise BadZipFile("File is not a zip file")
  10. zipfile.BadZipFile: File is not a zip file
复制代码
则删除Deforum插件,并且删除本地目录 C:\sd-webui-aki\sd-webui-aki-v4.1\models/Deforum\下的dpt_large-midas-2f21e586.pt文件。重新安装Deforum插件,并运行,会重新下载该文件。
最后重新运行即可。

来源:https://blog.csdn.net/BieberSen/article/details/131089271
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则