carson-katri / dream-textures

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

Zip Dependencies with Long Paths #788

Closed NullSenseStudio closed 3 months ago

NullSenseStudio commented 4 months ago

Currently Windows users struggle to install packaged releases due to errors caused by long paths, even when long paths are enabled for their system. Once installed a certain file has an entire path length of 259 characters when not including the Windows username. This became more of a noticeable issue in the last release due to a path in the transformers module growing by 11 characters.

To help prevent this issue, this PR zips the transformers module separately and enables it to be loaded like normal. Now the max path length is 225, so installing shouldn't be an issue as long as the username isn't more than 34 characters or another module grows in path length. This method is a little limiting as it only supports zipping modules that use .py files, no .dll or other special files. The new longest path belongs to torch, which is not compatible to shorten the path length further.

NullSenseStudio commented 4 months ago

The described issue encountered while installing:

FileNotFoundError: [Errno 2] No such file or directory: '...\\dream_textures\\.python_dependencies\\transformers\\models\\deprecated\\trajectory_transformer\\__pycache__\\convert_trajectory_transformer_original_pytorch_checkpoint_to_pytorch.cpython-310.pyc'

This error message is only noticeable with the system console window open. In my experience it just minimizes the preferences window so there is no proper feedback that this error occurred and the user continues on thinking it's just complete. Next when trying to enable the addon a new error will appear in the preferences UI:

ModuleNotFoundError: No module named 'dream_textures.api'

And in older versions it could appear as:

ModuleNotFoundError: No module named 'dream_textures.prompt_engineering'

This will at least fix the error while installing, though I am uncertain if there are other causes for the error when enabling the addon.