当前位置:   article > 正文

Stable Diffusion运行Deforum报错问题解决_dpt_large-midas-2f21e586.pt

dpt_large-midas-2f21e586.pt

运行Deforum时,需要在线下载dpt_large-midas-2f21e586.pt

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插件,并运行,会重新下载该文件。

最后重新运行即可。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/257710
推荐阅读
相关标签
  

闽ICP备14008679号