carson-katri / dream-textures

Stable Diffusion built-in to Blender
GNU General Public License v3.0
7.78k stars 418 forks source link

Release v0.3.0 #711

Closed carson-katri closed 10 months ago

GottfriedHofmann commented 11 months ago

Installing the addon on Windows 11 gives the following error that is likely due to the filepaths becoming too long (278 chars which is over the 255 max):

Traceback (most recent call last): File "C:\Users\g\Desktop\blender-3.6.4-windows-x64\3.6\scripts\startup\bl_operators\userpref.py", line 686, in execute file_to_extract.extractall(path_addons) File "C:\Users\g\Desktop\blender-3.6.4-windows-x64\3.6\python\lib\zipfile.py", line 1647, in extractall self._extract_member(zipinfo, path, pwd) File "C:\Users\g\Desktop\blender-3.6.4-windows-x64\3.6\python\lib\zipfile.py", line 1701, in _extract_member open(targetpath, "wb") as target: FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\g\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\dream_textures\.python_dependencies\transformers\models\deprecated\trajectory_transformer\pycache\convert_trajectory_transformer_original_pytorch_checkpoint_to_pytorch.cpython-310.pyc'

This happens even though I have long filepaths enabled in Win11 and a workaround is to manually unpack the .zip and copy the resulting directory over. That might give a hin that Python is the culprit here.

GottfriedHofmann commented 11 months ago

When I install and use the addon only with stabilityai/stable-diffusion-xl-base-1.0, I get the following error:

File "C:\Users\g\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\dream_textures\generator_process\actions\prompt_to_image.py", line 55, in prompt_to_image pipe, refiner = self.load_model(diffusers.AutoPipelineForText2Image, model, optimizations, scheduler, sdxl_refiner_model=sdxl_refiner_model) TypeError: cannot unpack non-iterable StableDiffusionXLPipeline object

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

Traceback (most recent call last): File "C:\Users\g\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\dream_textures\generator_process\future.py", line 101, in run_callbacks done_callback(self) File "C:\Users\g\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\dream_textures\diffusers_backend.py", line 252, in on_done result: ImageGenerationResult = future.result(last_only=True) File "C:\Users\g\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\dream_textures\generator_process\future.py", line 45, in result raise self._exception File "C:\Users\g\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\dream_textures\generator_process\future.py", line 88, in run_callbacks exception_callback(self, exception) File "C:\Users\g\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\dream_textures\diffusers_backend.py", line 258, in on_exception callback(exception) File "C:\Users\g\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\dream_textures\operators\dream_texture.py", line 151, in callback raise results TypeError: cannot unpack non-iterable StableDiffusionXLPipeline object Info: Total files 0 | Changed 0 | Failed 0

The error can be resolved by installing stabilityai/stable-diffusion-xl-refiner-1.0 as well and checking the box in the UI to use the refiner.

GottfriedHofmann commented 11 months ago

Rendering from the command line also fails, not sure wether this is the case only with this release so I created an issue: #713

carson-katri commented 11 months ago

@GottfriedHofmann I wasn't able to replicate the refiner issue. Could you share more information on your configuration?

NullSenseStudio commented 11 months ago

I've found the issue. It's only going down this branch as long as offloading is enabled or the device has enough memory to comfortably hold SDXL base and refiner together. This error will occur as long as a refiner isn't selected and either of the previous requirements are met. https://github.com/carson-katri/dream-textures/blob/fb1d1d09e2febad785827290adb9e923a0b3125e/generator_process/actions/prompt_to_image.py#L54-L55 It expects a tuple but load_model() is only returning a single pipeline because sdxl_refiner_model is None. Either this branch also needs to check for sdxl_refiner_model being None or load_model() needs a separate default value to determine returning a tuple or not.

GottfriedHofmann commented 10 months ago

@GottfriedHofmann I wasn't able to replicate the refiner issue. Could you share more information on your configuration?

It is fixed thanks to @NullSenseStudio . I think the issue came up becaues my RTX 3090 has 24 GByte of RAM and thus can hold the entire model.