Extraltodeus / depthmap2mask

Create masks out of depthmaps in img2img
355 stars 35 forks source link

Missing file when loading the script #31

Closed yanfr0818 closed 1 year ago

yanfr0818 commented 1 year ago

I installed through web UI, and restarted the UI multiple times. But I'm still getting the following exception:

Error loading script: depthmap_for_depth2img.py
Traceback (most recent call last):
  File "D:\WebUI\stable-diffusion-webui\modules\scripts.py", line 195, in load_scripts
    module = script_loading.load_module(scriptfile.path)
  File "D:\WebUI\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module
    exec(compiled, module.__dict__)
  File "D:\WebUI\stable-diffusion-webui\extensions\depthmap2mask\scripts\depthmap_for_depth2img.py", line 11, in <module>
    from repositories.midas.midas.dpt_depth import DPTDepthModel
  File "D:\WebUI\stable-diffusion-webui\repositories\midas\midas\dpt_depth.py", line 5, in <module>
    from .blocks import (
  File "D:\WebUI\stable-diffusion-webui\repositories\midas\midas\blocks.py", line 21, in <module>
    from .backbones.next_vit import (
  File "D:\WebUI\stable-diffusion-webui\repositories\midas\midas\backbones\next_vit.py", line 8, in <module>
    file = open("./externals/Next_ViT/classification/nextvit.py", "r")
FileNotFoundError: [Errno 2] No such file or directory: './externals/Next_ViT/classification/nextvit.py'
cooperdk commented 1 year ago

This is because the guy who wrote Midas only thinks that people use Linux. There is a shell script to install Next-ViT in the code.

You need to be in the webui root folder, then enter

git clone https://github.com/bytedance/Next-ViT.git externals/Next_ViT

For some reason, the guy who wrote midas thinks nobody uses his stuff in any app. So it breaks in this new version of MiDas unless you do this. Goes for all depthmap extensions as well as multi-subject-render

It is the same for all apps that use the midas repository. That is simple_depthmask and multi-subject-render and this one.

I have asked the developer of MiDas to load NextViT in some other way because NOBODY can use his code in their own project without moving stuff around.

yanfr0818 commented 1 year ago

git clone https://github.com/bytedance/Next-ViT.git externals/Next_ViT Thanks! It solved this issue. Like you said, I wasn't aware that the majority of the Midas users are on Linux. It's important to know that there is an extra package to install for Windows.

alenknight commented 1 year ago

oh man i just had this problem too . thanks for the heads up on this.