fast-stable-diffusion icon indicating copy to clipboard operation
fast-stable-diffusion copied to clipboard

Trying to load depth2img extension on colab

Open Subaru17 opened this issue 2 years ago • 10 comments

Im using this colab version running 1.5 model: https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb

Error loading script: depthmap_for_depth2img.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 184, in load_scripts module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module exec(compiled, module.dict) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/depthmap2mask/scripts/depthmap_for_depth2img.py", line 11, in from repositories.midas.midas.dpt_depth import DPTDepthModel ModuleNotFoundError: No module named 'repositories'

Subaru17 avatar Nov 29 '22 20:11 Subaru17

the problem with the extensions devs is that they use hardcoded paths instead of calling paths.py of the webui. I'll see what I can do

TheLastBen avatar Nov 29 '22 21:11 TheLastBen

Im using this colab version running 1.5 model: https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb

Error loading script: depthmap_for_depth2img.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 184, in load_scripts module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module exec(compiled, module.dict) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/depthmap2mask/scripts/depthmap_for_depth2img.py", line 11, in from repositories.midas.midas.dpt_depth import DPTDepthModel ModuleNotFoundError: No module named 'repositories'

try to put this cell after installing Automatic 1111 repo:

#@markdown # (Optional) Install Depth Map Script %pwd %pushd . %cd ./scripts !wget https://raw.githubusercontent.com/thygate/stable-diffusion-webui-depthmap-script/main/depthmap.py %popd !pwd !git clone https://github.com/isl-org/MiDaS.git repositories/midas

Maxxxwell62 avatar Nov 29 '22 21:11 Maxxxwell62

Maxxxwell62 This is what i get Error loading script: tag_autocomplete_helper.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 184, in load_scripts module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module exec(compiled, module.dict) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 89, in write_tag_base_path() File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 64, in write_tag_base_path f.write(TAGS_PATH.relative_to(FILE_DIR).as_posix()) File "/usr/lib/python3.7/pathlib.py", line 900, in relative_to .format(str(self), str(formatted))) ValueError: '/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/tags' does not start with '/content/gdrive/MyDrive/sd/stablediffusion'

Error loading script: api.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 184, in load_scripts module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module compiled = compile(text, path, 'exec') File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd_dreambooth_extension/scripts/api.py", line 14 db_half_model: bool = False,

Subaru17 avatar Nov 29 '22 21:11 Subaru17

Maxxxwell62 This is what i get Error loading script: tag_autocomplete_helper.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 184, in load_scripts module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module exec(compiled, module.dict) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 89, in write_tag_base_path() File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 64, in write_tag_base_path f.write(TAGS_PATH.relative_to(FILE_DIR).as_posix()) File "/usr/lib/python3.7/pathlib.py", line 900, in relative_to .format(str(self), str(formatted))) ValueError: '/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/tags' does not start with '/content/gdrive/MyDrive/sd/stablediffusion'

Error loading script: api.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 184, in load_scripts module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module compiled = compile(text, path, 'exec') File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd_dreambooth_extension/scripts/api.py", line 14 db_half_model: bool = False,

i don't know how to fix it

Maxxxwell62 avatar Nov 29 '22 22:11 Maxxxwell62

Hi run this, with this have to run you dont have warnings for start.

import os SD_webui_path = "/content/gdrive/MyDrive/sd/stable-diffusion-webui" #@param {type:"string"} os.chdir(SD_webui_path)

%cd extensions !git clone https://github.com/Extraltodeus/depthmap2mask.git !git clone https://github.com/d8ahazard/sd_dreambooth_extension.git

%cd .. !mkdir repositories %cd repositories !git clone https://github.com/isl-org/MiDaS.git


later open the api file in scripts for dreambooth and delete , , , in this section something like this

db_half_model: bool = False ,
db_use_concepts: bool = False ,
db_pretrained_model_name_or_path: str ,

For

db_half_model: bool = False
db_use_concepts: bool = False
db_pretrained_model_name_or_path: str

And later you can see the extension in the webui, but you find other problem like this and i dont find solution yet

File "", line 724, in exec_module File "", line 859, in get_code File "", line 916, in get_data FileNotFoundError: [Errno 2] No such file or directory: 'extensions/depthmap2mask/scripts/depthmap_for_depth2img.py'

wilzamguerrero avatar Nov 30 '22 06:11 wilzamguerrero

fixed

TheLastBen avatar Dec 02 '22 04:12 TheLastBen

Thank you, TheLastBen i can write for private, i know that have many work with this and many issues but if you have time please look this link, https://github.com/wilzamguerrero/SDZ

wilzamguerrero avatar Dec 04 '22 00:12 wilzamguerrero

Thanks ; note though that this extension is not depth2image but depthmap2mask.

xaviersingy avatar Dec 04 '22 17:12 xaviersingy

still cant load @TheLastBen

Error loading script: depthmap_for_depth2img.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 184, in load_scripts module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module exec(compiled, module.dict) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/depthmap2mask/scripts/depthmap_for_depth2img.py", line 11, in from repositories.midas.midas.dpt_depth import DPTDepthModel ModuleNotFoundError: No module named 'repositories.midas'

Subaru17 avatar Dec 05 '22 08:12 Subaru17

fixed

TheLastBen avatar Dec 07 '22 13:12 TheLastBen