TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.51k stars 1.31k forks source link

Trying to load depth2img extension on colab #750

Open Subaru17 opened 1 year ago

Subaru17 commented 1 year ago

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'

TheLastBen commented 1 year ago

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

Maxxxwell62 commented 1 year ago

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

Subaru17 commented 1 year ago

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,

Maxxxwell62 commented 1 year ago

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

wilzamguerrero commented 1 year ago

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'

TheLastBen commented 1 year ago

fixed

wilzamguerrero commented 1 year ago

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

xaviersingy commented 1 year ago

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

Subaru17 commented 1 year ago

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'

TheLastBen commented 1 year ago

fixed