dream-textures icon indicating copy to clipboard operation
dream-textures copied to clipboard

<title>Cannot download model once addon is installed

Open dradex opened this issue 2 years ago • 29 comments

Description

I downloaded the addon, and it installs fine. (0.0.9), and when I click on "Download Stable Diffusion v2.1", it downloads for a fraction of a second and goes back (Looks like it says 0%). When I click on "import checkpoint file" and import sd-v1-4.ckpt, it says "DLL load failed while importing _psutil_windows: The specified module could not be found."

Steps to Reproduce

  1. Go to https://github.com/carson-katri/dream-textures/releases
  2. Install the file with the hyperlink that says "Dream Textures for Windows (CUDA)"
  3. Extract with 7zip to a Zip file
  4. Install as addon to blender
  5. Click on "Download Stable Diffusion v2.1"

Expected Behavior

I expect it to download and let me use the addon

Addon Version

Windows (CUDA)

GPU

NVIDIA

dradex avatar Dec 15 '22 23:12 dradex

The model is several GBs large. Please wait for it to complete. The bar resets for each file it downloads.

carson-katri avatar Dec 15 '22 23:12 carson-katri

The model is several GBs large. Please wait for it to complete. The bar resets for each file it downloads.

How do I know if it's finished / in the middle of downloading? How long does it usually take?

dradex avatar Dec 15 '22 23:12 dradex

Mine downloaded, but it still says I need to download it, and after that clicking to download does nothing and just cycles the button over and over.

WACOMalt avatar Dec 15 '22 23:12 WACOMalt

Animated Gif, click to play it. wontdownload

WACOMalt avatar Dec 15 '22 23:12 WACOMalt

If you open Window > Toggle System Console are there any errors?

Perhaps also check the folder at C:\Users\youruser\.cache\huggingface\diffusers\ and see if the model is there. If it is delete it and try downloading again?

carson-katri avatar Dec 15 '22 23:12 carson-katri

There's no folder called that. In hugging face, there's "hub" and "transformers" but no "diffusers"

dradex avatar Dec 15 '22 23:12 dradex

For the error, it keeps repeating "Traceback (most recent call last): File "C:\Users\drade\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\dream_textures\operators\project.py", line 106, in draw r.enabled = Pipeline[context.scene.dream_textures_project_prompt.pipeline].depth() and bpy.context.object.mode == 'EDIT' AttributeError: 'NoneType' object has no attribute 'mode'"

dradex avatar Dec 15 '22 23:12 dradex

Similar results for me in the console.

Read prefs: C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\config\userpref.blend
Exception: Traceback (most recent call last):
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actor.py", line 271, in _receive
    response = getattr(self, message.method_name)(*message.args, **message.kwargs)
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actions\huggingface_hub.py", line 90, in hf_list_installed_models
    return [_map_model(file) for file in os.listdir(DIFFUSERS_CACHE) if os.path.isdir(os.path.join(DIFFUSERS_CACHE, file))]
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actions\huggingface_hub.py", line 90, in <listcomp>
    return [_map_model(file) for file in os.listdir(DIFFUSERS_CACHE) if os.path.isdir(os.path.join(DIFFUSERS_CACHE, file))]
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actions\huggingface_hub.py", line 72, in _map_model
    with open(ref_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\WACOMalt/.cache\\huggingface\\diffusers\\models--CompVis--stable-diffusion-v1-4\\refs\\main'


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actor.py", line 111, in run_callbacks
    done_callback(self)
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\preferences.py", line 185, in on_done
    set_model_list('installed_models', future.result())
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actor.py", line 58, in result
    raise self._exception
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\WACOMalt/.cache\\huggingface\\diffusers\\models--CompVis--stable-diffusion-v1-4\\refs\\main'

WACOMalt avatar Dec 15 '22 23:12 WACOMalt

@WACOMalt can you delete this folder: C:\Users\WACOMalt/.cache\huggingface\diffusers\models--CompVis--stable-diffusion-v1-4 and try downloading it again? Or download a different model?

carson-katri avatar Dec 15 '22 23:12 carson-katri

I only clicked the 2.1 download button. But yes I can delete that folder. I think its been created by one of the many other stable diffusion projects I've used.

WACOMalt avatar Dec 15 '22 23:12 WACOMalt

@WACOMalt possibly, lots of tools use diffusers. That could be handled better here for sure.

carson-katri avatar Dec 15 '22 23:12 carson-katri

Ok after deleting that folder the Download Stable Diffusion 2.1 button worked and immediately completed. I now see stabilityai/stable0diffusion-2-1 listed in my models. I'm skeptical if it actually downloaded though unless it was already done and just moving the file as it went so far. Testing now.

WACOMalt avatar Dec 15 '22 23:12 WACOMalt

@dradex that error is unrelated afaict. If that folder doesn’t exist then the model is not downloading. You can look for another error in the console or wait for it to complete. Maybe also try putting a hugging face hub key in if the model required auth for some reason?

carson-katri avatar Dec 15 '22 23:12 carson-katri

image

WACOMalt avatar Dec 15 '22 23:12 WACOMalt

@WACOMalt you need the depth model for that feature. You can search for it in the addon preferences.

carson-katri avatar Dec 15 '22 23:12 carson-katri

Can I just create a new folder called "diffusers"

dradex avatar Dec 15 '22 23:12 dradex

It should create it for you

carson-katri avatar Dec 15 '22 23:12 carson-katri

I reinstalled the addon, deleted the main folder, and it's doing the same thing. There's no folder and I waited and still nothing has happened

dradex avatar Dec 15 '22 23:12 dradex

*The main folder is reinstalled just not the diffusers one

dradex avatar Dec 15 '22 23:12 dradex

Does anything different show in the console?

carson-katri avatar Dec 15 '22 23:12 carson-katri

Traceback (most recent call last): File "C:\Users\drade\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\dream_textures\generator_process\actor.py", line 111, in run_callbacks done_callback(self) File "C:\Users\drade\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\dream_textures\preferences.py", line 185, in on_done set_model_list('installed_models', future.result()) File "C:\Users\drade\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\dream_textures\generator_process\actor.py", line 58, in result raise self._exception ImportError: DLL load failed while importing _psutil_windows: The specified module could not be found.

dradex avatar Dec 15 '22 23:12 dradex

@dradex could you maybe try installing blender again? Could try 3.4 to see if that has any effect.

carson-katri avatar Dec 15 '22 23:12 carson-katri

oh sorry, my addon trials this time were in fact in 3.4. It seems to have successfully downloaded but now says I need to download a depth model to use it.

WACOMalt avatar Dec 15 '22 23:12 WACOMalt

Now I manually downloaded the stable-diffusion-2-depth model but when choosing it in the dream panel I get the error image

And this in the console.

Read prefs: C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\config\userpref.blend
The config attributes {'depth_estimator': ['transformers', 'DPTForDepthEstimation']} were passed to GeneratorPipeline, but are not expected and will be ignored. Please verify your model_index.json configuration file.
Keyword arguments {'depth_estimator': ['transformers', 'DPTForDepthEstimation']} are not expected by GeneratorPipeline and will be ignored.
Exception: Traceback (most recent call last):
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actor.py", line 273, in _receive
    for res in iter(response):
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actions\depth_to_image.py", line 333, in depth_to_image
    pipe = GeneratorPipeline.from_pretrained(
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\.python_dependencies\diffusers\pipeline_utils.py", line 711, in from_pretrained
    loaded_sub_model = load_method(cached_folder, **loading_kwargs)
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\.python_dependencies\diffusers\modeling_utils.py", line 452, in from_pretrained
    model_file = cls._get_model_file(
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\.python_dependencies\diffusers\modeling_utils.py", line 593, in _get_model_file
    raise EnvironmentError(
OSError: Error no file named diffusion_pytorch_model.bin found in directory C:\Users\WACOMalt/.cache\huggingface\diffusers\models--stabilityai--stable-diffusion-2-depth\snapshots\3d8508e740daa5aadca5af4e4cd978490b0f8110.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\generator_process\actor.py", line 98, in run_callbacks
    exception_callback(self, exception)
  File "C:\Users\WACOMalt\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\dream_textures\operators\project.py", line 171, in on_exception
    raise exception
OSError: Error no file named diffusion_pytorch_model.bin found in directory C:\Users\WACOMalt/.cache\huggingface\diffusers\models--stabilityai--stable-diffusion-2-depth\snapshots\3d8508e740daa5aadca5af4e4cd978490b0f8110.

WACOMalt avatar Dec 16 '22 00:12 WACOMalt

Fixed it by deleting C:\Users\WACOMalt.cache\huggingface\diffusers\models--stabilityai--stable-diffusion-2-depth and redownloading via the addon the same way as the first try.

WACOMalt avatar Dec 16 '22 00:12 WACOMalt

I have same problem, it flashes for a second and does not appear to download anything. I am using Blender 3.3

I get this error in the console image

nikolatesla20 avatar Dec 16 '22 04:12 nikolatesla20

Traceback (most recent call last): File "C:\Users\drade\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\dream_textures\generator_process\actor.py", line 111, in run_callbacks done_callback(self) File "C:\Users\drade\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\dream_textures\preferences.py", line 185, in on_done set_model_list('installed_models', future.result()) File "C:\Users\drade\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\dream_textures\generator_process\actor.py", line 58, in result raise self._exception ImportError: DLL load failed while importing _psutil_windows: The specified module could not be found.

I get same error, Blender 3.3

nikolatesla20 avatar Dec 16 '22 04:12 nikolatesla20

"Solved" by downloading and using Blender 3.4 with the addon

nikolatesla20 avatar Dec 16 '22 04:12 nikolatesla20

I've found one cause of ImportError: DLL load failed while importing _psutil_windows: The specified module could not be found. is from having an old version of the addon previously installed where its dependencies are installed to Blender's site-packages (version 0.0.5 or older).

You'll either have to reinstall Blender (and make sure all files/folders are also deleted), or install a different version of Blender.

NullSenseStudio avatar Dec 24 '22 23:12 NullSenseStudio

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Feb 26 '23 02:02 github-actions[bot]