Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'repositories.midas' #24

Open
patrickmac110 opened this issue Dec 9, 2022 · 5 comments
Open

ModuleNotFoundError: No module named 'repositories.midas' #24

patrickmac110 opened this issue Dec 9, 2022 · 5 comments

Comments

@patrickmac110
Copy link

Upon launch, I get this error: Error loading script: depthmap_for_depth2img.py

Traceback (most recent call last):
File "A:\Desktop\00 AI Images\stable-diffusion-webui\modules\scripts.py", line 184, in load_scripts
module = script_loading.load_module(scriptfile.path)
File "A:\Desktop\00 AI Images\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module
exec(compiled, module.dict)
File "A:\Desktop\00 AI Images\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'

And when I try to run your script, I get this error:

Error completing request
Arguments: (0, 'a mushroom like structure with a colorful sky in the background and plants and rocks in the foreground, and a few mushrooms in the foreground, by Paul Lehr', '', 'None', 'None', <PIL.Image.Image image mode=RGB size=1536x1536 at 0x6FD03640>, None, None, None, None, 0, 150, 0, 4, 0, 0, False, False, 1, 1, 7, 0.75, -1.0, -1.0, 0, 0, 0, False, 512, 512, 0, False, 32, 0, '', '', 10, '

\n

Combinations

\n\n Choose a number of terms from a list, in this case we choose two artists: \n {2$$artist1|artist2|artist3}
\n\n If $$ is not provided, then 1$$ is assumed.

\n\n If the chosen number of terms is greater than the available terms, then some terms will be duplicated, otherwise chosen terms will be unique. This is useful in the case of wildcards, e.g.\n {2$$artist} is equivalent to {2$$artist|artist}

\n\n A range can be provided:\n {1-3$$artist1|artist2|artist3}
\n In this case, a random number of artists between 1 and 3 is chosen.

\n\n Wildcards can be used and the joiner can also be specified:\n {{1-$$and$$adjective}}
\n\n Here, a random number between 1 and 3 words from adjective.txt will be chosen and joined together with the word 'and' instead of the default comma.\n\n

\n\n

Wildcards

\n \n\n
\n If the groups wont drop down click here to fix the issue.\n\n

\n\n WILDCARD_DIR: A:\Desktop\00 AI Images\stable-diffusion-webui\extensions\sd-dynamic-prompts\wildcards
\n You can add more wildcards by creating a text file with one term per line and name is mywildcards.txt. Place it in A:\Desktop\00 AI Images\stable-diffusion-webui\extensions\sd-dynamic-prompts\wildcards. <folder>/mywildcards will then become available.\n
\n\n', True, False, 1, False, False, False, 100, 0.7, False, False, False, False, False, False, '
    \n
  • CFG Scale should be 2 or lower.
  • \n
\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 1, '

Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8

', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, False, '', '

Will upscale the image to twice the dimensions; use width and height sliders to set tile size

', 64, 0, 1, '', 0, '', True, False, False, '

Deforum v0.5-webui-beta

', '

This script is deprecated. Please use the full Deforum extension instead.
\nUpdate instructions:

', '

github.com/deforum-art/deforum-for-automatic1111-webui/blob/automatic1111-webui/README.md

', '

discord.gg/deforum

', True, 0, True, 384, 384, False, 2, True, True, False, False, False, 4.0, '', 10.0, False, True, True, 30.0, True, False, False, 0, 0.0, 10.0, True, 30.0, True, '{inspiration}', None, 'linear', '30', 'grad_min', 0.01, 1, 'clip', 1.0, 1.0, 'mp4', 10.0, 0, 1, False, True) {}
Traceback (most recent call last):
File "A:\Desktop\00 AI Images\stable-diffusion-webui\modules\call_queue.py", line 45, in f
res = list(func(*args, **kwargs))
File "A:\Desktop\00 AI Images\stable-diffusion-webui\modules\call_queue.py", line 28, in f
res = func(*args, **kwargs)
File "A:\Desktop\00 AI Images\stable-diffusion-webui\modules\img2img.py", line 150, in img2img
processed = modules.scripts.scripts_img2img.run(p, *args)
File "A:\Desktop\00 AI Images\stable-diffusion-webui\modules\scripts.py", line 317, in run
processed = script.run(p, *script_args)
File "A:\Desktop\00 AI Images\stable-diffusion-webui\extensions\depthmap2mask\scripts\depth2image_depthmask.py", line 76, in run
sdmg = module_from_file("depthmap_for_depth2img",'extensions/depthmap2mask/scripts/depthmap_for_depth2img.py')
File "A:\Desktop\00 AI Images\stable-diffusion-webui\extensions\depthmap2mask\scripts\depth2image_depthmask.py", line 22, in module_from_file
spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "A:\Desktop\00 AI Images\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'

@funParadox
Copy link

Can you already fix the problem, I have the same problem, can you tell me your solution

@funParadox
Copy link

I have soluted.
just clone https://github.com/isl-org/MiDaS into repositories

@Extraltodeus
Copy link
Owner

have you guys copied the install.py that is into this repository in the folder with the rest of if? Because it should normally clone midas into the repositories automatically when you install the extension or restart the webui after installing it.

@patrickmac110
Copy link
Author

I have manually installed it by downloading the zip and copying the entire contents into the scripts folder, I've also used webui's extensions tab to install it automatically, I've also checked in the repositories folder and seen that I have Midas installed there and when I try following funParadox's solution by git cloning midas, it says it already exists there, because it does... I'm very confused

@Extraltodeus
Copy link
Owner

Extraltodeus commented Dec 14, 2022

If you installed it from the webui after copying it that might be why. Delete this extension's folder and just install it from the webui.

Also it should not be in the script folder but the extension folder. Check out the readme as there is the file tree that you can use to compare to your installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants