torrinworx / cozy-auto-texture Goto Github PK
View Code? Open in Web Editor NEWA Blender add-on for generating free textures using the Stable Diffusion AI text to image model.
License: GNU General Public License v3.0
A Blender add-on for generating free textures using the Stable Diffusion AI text to image model.
License: GNU General Public License v3.0
After installing the add-on successfully, and installing the dependencies, if the user (or developer) restarts the add-on with CTRL+R, Cozy Auto Texture reverts back to it's pre-dependency state:
This error message also appears in the Blender System Console:
Reloading: <module 'bl_operators' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\bl_operators\\__init__.py'>
Reloading: <module 'bl_ui' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\bl_ui\\__init__.py'>
Reloading: <module 'keyingsets_builtins' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\keyingsets_builtins.py'>
Reloading: <module 'nodeitems_builtins' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\nodeitems_builtins.py'>
reloading addon: Cozy-Auto-Texture 1662345437.949952 1662345676.4157345 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\addons\\Cozy-Auto-Texture\\__init__.py'
module changed on disk: 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\addons\\Cozy-Auto-Texture\\__init__.py' reloading...
Exception in module register(): D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py
Traceback (most recent call last):
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\modules\addon_utils.py", line 371, in enable
mod.register()
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py", line 418, in register
import_module(module_name=dependency.module, global_name=dependency.name)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py", line 104, in import_module
importlib.reload(globals()[global_name])
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\importlib\__init__.py", line 169, in reload
_bootstrap._exec(spec, module)
File "<frozen importlib._bootstrap>", line 619, in _exec
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\torch\__init__.py", line 74, in <module>
if all([not os.path.exists(os.path.join(p, 'nvToolsExt64_1.dll')) for p in dll_paths]):
TypeError: all(): argument 'input' (position 1) must be Tensor, not list
gc.collect() -> 10367
The down side to this is that you need to delete all the dependencies, restart Blender, and fresh install the dependencies in order for Cozy Auto Texture to function with the new changes.
Various error messages occur after the user attempts to generate a texture:
Read prefs: C:\Users\torri\AppData\Roaming\Blender Foundation\Blender\3.2\config\userpref.blend
D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\torch\_utils.py:133: UserWarning: Failed to initialize NumPy: module compiled against API version 0x10 but this version of numpy is 0xf (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:68.)
t = torch.tensor([], dtype=storage.dtype, device=storage._untyped().device)
ftfy or spacy is not installed using BERT BasicTokenizer instead of ftfy.
Traceback (most recent call last):
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py", line 233, in execute
text2img(UserInput)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\src\main.py", line 47, in text2img
pipe = StableDiffusionPipeline.from_pretrained(model_path) # Specify model path
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\pipeline_utils.py", line 247, in from_pretrained
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\configuration_utils.py", line 97, in from_config
model = cls(**init_dict)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\configuration_utils.py", line 312, in inner_init
init(self, *args, **init_kwargs)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\schedulers\scheduling_pndm.py", line 98, in __init__
self.set_format(tensor_format=tensor_format)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\schedulers\scheduling_utils.py", line 33, in set_format
setattr(self, key, torch.from_numpy(value))
RuntimeError: Numpy is not available
Error: Python: Traceback (most recent call last):
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py", line 233, in execute
text2img(UserInput)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\src\main.py", line 47, in text2img
pipe = StableDiffusionPipeline.from_pretrained(model_path) # Specify model path
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\pipeline_utils.py", line 247, in from_pretrained
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\configuration_utils.py", line 97, in from_config
model = cls(**init_dict)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\configuration_utils.py", line 312, in inner_init
init(self, *args, **init_kwargs)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\schedulers\scheduling_pndm.py", line 98, in __init__
self.set_format(tensor_format=tensor_format)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\schedulers\scheduling_utils.py", line 33, in set_format
setattr(self, key, torch.from_numpy(value))
RuntimeError: Numpy is not available
Reloading: <module 'bl_operators' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\bl_operators\\__init__.py'>
Reloading: <module 'bl_ui' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\bl_ui\\__init__.py'>
Reloading: <module 'keyingsets_builtins' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\keyingsets_builtins.py'>
Reloading: <module 'nodeitems_builtins' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\nodeitems_builtins.py'>
Exception in module register(): D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py
Traceback (most recent call last):
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\modules\addon_utils.py", line 371, in enable
mod.register()
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py", line 447, in register
import_module(module_name=dependency.module, global_name=dependency.name)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py", line 112, in import_module
importlib.reload(globals()[global_name])
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\importlib\__init__.py", line 169, in reload
_bootstrap._exec(spec, module)
File "<frozen importlib._bootstrap>", line 619, in _exec
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\torch\__init__.py", line 74, in <module>
if all([not os.path.exists(os.path.join(p, 'nvToolsExt64_1.dll')) for p in dll_paths]):
TypeError: all(): argument 'input' (position 1) must be Tensor, not list
gc.collect() -> 37358
addon_utils.disable: Cozy-Auto-Texture not disabled
Reloading: <module 'bl_operators' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\bl_operators\\__init__.py'>
Reloading: <module 'bl_ui' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\bl_ui\\__init__.py'>
Reloading: <module 'keyingsets_builtins' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\keyingsets_builtins.py'>
Reloading: <module 'nodeitems_builtins' from 'D:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\scripts\\startup\\nodeitems_builtins.py'>
gc.collect() -> 36144
ftfy or spacy is not installed using BERT BasicTokenizer instead of ftfy.
Traceback (most recent call last):
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py", line 233, in execute
text2img(UserInput)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\src\main.py", line 47, in text2img
pipe = StableDiffusionPipeline.from_pretrained(model_path) # Specify model path
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\pipeline_utils.py", line 247, in from_pretrained
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\configuration_utils.py", line 97, in from_config
model = cls(**init_dict)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\configuration_utils.py", line 312, in inner_init
init(self, *args, **init_kwargs)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\schedulers\scheduling_pndm.py", line 98, in __init__
self.set_format(tensor_format=tensor_format)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\schedulers\scheduling_utils.py", line 33, in set_format
setattr(self, key, torch.from_numpy(value))
RuntimeError: Numpy is not available
Error: Python: Traceback (most recent call last):
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\__init__.py", line 233, in execute
text2img(UserInput)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\addons\Cozy-Auto-Texture\src\main.py", line 47, in text2img
pipe = StableDiffusionPipeline.from_pretrained(model_path) # Specify model path
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\pipeline_utils.py", line 247, in from_pretrained
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\configuration_utils.py", line 97, in from_config
model = cls(**init_dict)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\configuration_utils.py", line 312, in inner_init
init(self, *args, **init_kwargs)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\schedulers\scheduling_pndm.py", line 98, in __init__
self.set_format(tensor_format=tensor_format)
File "D:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages\diffusers\schedulers\scheduling_utils.py", line 33, in set_format
setattr(self, key, torch.from_numpy(value))
RuntimeError: Numpy is not available
The majority of this is to do with Numpy or Transformers, I believe it's an issue with the Stable Diffusion download not knowing what Python version to use as it's installed within Blenders add-on system and might be using the users Python version. However I have not determined if this is the root cause, it's just my suspicion.
The Stable Diffusion license provided by Hugging Face should be displayed or a link provided to the user before they download the Stable Diffusion model. It should be a checkbox located in the download dependencies section of the add-on preferences.
Python: Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'C:\Tools\Blender\CozyAutoTexture\Cozy-Auto-Texture-Files\venv\Scripts\activate.bat' returned non-zero exit status 1.
Is there a tutorial on how to use it?๐
I think this can be solved by checking the Environment path the user specified in the Preferences section since this is kept in Blender's memory.
Other:
Hello,
Thanks for your amazing work.
Excuse the noob question, but installing the dependencies does not seem to work.
Any idea why this could be or how to solve it?
Thanks you.
Watch stream.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.