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

macOS development tester error result #90

Closed
enzyme69 opened this issue Dec 1, 2023 · 22 comments
Closed

macOS development tester error result #90

enzyme69 opened this issue Dec 1, 2023 · 22 comments

Comments

@enzyme69
Copy link

enzyme69 commented Dec 1, 2023

I am trying the macOS branch, hopefully to run this with proper CPU and transformers...

Prompt: impressionist painting IMG_4087, man and corgi portrait. loose brushwork, vibrant color, light and shadow play, captures feeling over form
Negative Prompt: anime, photorealistic, 35mm film, deformed, low contrast, noisy
Load: img2img/vid2img Model
Conversion Model:  stabilityai/sdxl-turbo
model_index.json: 100%|████████████████████████| 685/685 [00:00<00:00, 3.36MB/s]
text_encoder/config.json: 100%|████████████████| 565/565 [00:00<00:00, 5.77MB/s]
scheduler/scheduler_config.json: 100%|█████████| 459/459 [00:00<00:00, 4.10MB/s]
tokenizer/tokenizer_config.json: 100%|█████████| 704/704 [00:00<00:00, 3.70MB/s]
tokenizer/merges.txt: 100%|██████████████████| 525k/525k [00:00<00:00, 13.4MB/s]
tokenizer/special_tokens_map.json: 100%|███████| 586/586 [00:00<00:00, 9.14MB/s]
tokenizer/special_tokens_map.json:   0%|              | 0.00/586 [00:00<?, ?B/s]
tokenizer_2/special_tokens_map.json: 100%|█████████████████| 460/460 [00:00<00:00, 3.24MB/s]
tokenizer_2/tokenizer_config.json: 100%|███████████████████| 855/855 [00:00<00:00, 12.9MB/s]
text_encoder_2/config.json: 100%|██████████████████████████| 575/575 [00:00<00:00, 8.12MB/s]
unet/config.json: 100%|████████████████████████████████| 1.78k/1.78k [00:00<00:00, 23.6MB/s]
tokenizer/vocab.json: 100%|████████████████████████████| 1.06M/1.06M [00:00<00:00, 3.12MB/s]
vae/config.json: 100%|█████████████████████████████████████| 607/607 [00:00<00:00, 9.79MB/s]
tokenizer_2/vocab.json: 100%|██████████████████████████| 1.06M/1.06M [00:01<00:00, 1.02MB/s]
diffusion_pytorch_model.fp16.safetensors: 100%|██████████| 167M/167M [00:54<00:00, 3.04MB/s]
model.fp16.safetensors: 100%|██████████████████████████| 246M/246M [01:07<00:00, 3.66MB/s]s]
model.fp16.safetensors: 100%|███████████████████████| 1.39G/1.39G [03:43<00:00, 6.23MB/s]]s]
diffusion_pytorch_model.fp16.safetensors: 100%|████████| 5.14G/5.14G [08:26<00:00, 10.1MB/s]
Fetching 18 files: 100%|████████████████████████| 18/18 [08:28<00:00, 28.23s/it]2, 4.25MB/s]
The config attributes {'feature_extractor': [None, None], 'image_encoder': [None, None]} were passed to StableDiffusionXLImg2ImgPipeline, but are not expected and will be ignored. Please verify your model_index.json configuration file.
Keyword arguments {'feature_extractor': [None, None], 'image_encoder': [None, None]} are not expected by StableDiffusionXLImg2ImgPipeline and will be ignored.
Loading pipeline components...:  14%|█████▌                                 | 1/7 [00:00<00:00,  6.29it/s]The config attributes {'attention_type': 'default', 'dropout': 0.0, 'reverse_transformer_layers_per_block': None} were passed to UNet2DConditionModel, but are not expected and will be ignored. Please verify your config.json configuration file.
Loading pipeline components...: 100%|███████████████████████████████████████| 7/7 [00:01<00:00,  6.35it/s]
Seed: 4087
Process: Image to Image
Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3636, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3636, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA eTraceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 4120, in execute
    sequencer.generate_image()
  File "/Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3636, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Location: /Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py:113

Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 4120, in execute
    sequencer.generate_image()
  File "/Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3636, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Location: /Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py:113


@enzyme69
Copy link
Author

enzyme69 commented Dec 1, 2023

I checked the log during "install dependencies" got errors:

Installing collected packages: libclang, flatbuffers, wrapt, wheel, werkzeug, termcolor, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard-data-server, pyasn1, protobuf, opt-einsum, oauthlib, ml-dtypes, markdown, keras, h5py, grpcio, google-pasta, gast, cachetools, absl-py, rsa, requests-oauthlib, pyasn1-modules, astunparse, google-auth, google-auth-oauthlib, tensorboard, tensorflow-macos, tensorflow
Successfully installed absl-py-2.0.0 astunparse-1.6.3 cachetools-5.3.2 flatbuffers-23.5.26 gast-0.5.4 google-auth-2.24.0 google-auth-oauthlib-1.1.0 google-pasta-0.2.0 grpcio-1.59.3 h5py-3.10.0 keras-2.15.0 libclang-16.0.6 markdown-3.5.1 ml-dtypes-0.2.0 oauthlib-3.2.2 opt-einsum-3.3.0 protobuf-4.23.4 pyasn1-0.5.1 pyasn1-modules-0.3.0 requests-oauthlib-1.3.1 rsa-4.9 tensorboard-2.15.1 tensorboard-data-server-0.7.2 tensorflow-2.15.0 tensorflow-estimator-2.15.0 tensorflow-io-gcs-filesystem-0.34.0 tensorflow-macos-2.15.0 termcolor-2.4.0 werkzeug-3.0.1 wheel-0.42.0 wrapt-1.14.1
Installing: soundfile module
Collecting PySoundFile
  Downloading PySoundFile-0.9.0.post1-py2.py3-none-any.whl (24 kB)
Collecting cffi>=0.6 (from PySoundFile)
  Using cached cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl.metadata (1.5 kB)
Collecting pycparser (from cffi>=0.6->PySoundFile)
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using cached cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl (176 kB)
Installing collected packages: pycparser, cffi, PySoundFile
Successfully installed PySoundFile-0.9.0.post1 cffi-1.16.0 pycparser-2.21
Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 567, in import_module
    subprocess.call([python_exe, "import ", packageName])
NameError: name 'packageName' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/soundfile.py", line 267, in <module>
    _snd = _ffi.dlopen('sndfile')
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: ctypes.util.find_library() did not manage to locate a library called 'sndfile'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 855, in execute
    install_modules(self)
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 699, in install_modules
    import_module(self, "soundfile", "PySoundFile")
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 596, in import_module
    exec("import " + module)
  File "<string>", line 1, in <module>
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/soundfile.py", line 276, in <module>
    _snd = _ffi.dlopen(_os.path.join(
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib, 0x0002): tried: '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file).  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib'
Info: Installing: huggingface_hub module.
Info: Installing: accelerate module.
Info: Installing: bark module.
Info: Installing: diffusers module.
Info: Installing: tensorflow module.
Info: Installing: soundfile module.
Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 567, in import_module
    subprocess.call([python_exe, "import ", packageName])
NameError: name 'packageName' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/soundfile.py", line 267, in <module>
    _snd = _ffi.dlopen('sndfile')
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: ctypes.util.find_library() did not manage to locate a library called 'sndfile'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 855, in execute
    install_modules(self)
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 699, in install_modules
    import_module(self, "soundfile", "PySoundFile")
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 596, in import_module
    exec("import " + module)
  File "<string>", line 1, in <module>
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/soundfile.py", line 276, in <module>
    _snd = _ffi.dlopen(_os.path.join(
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib, 0x0002): tried: '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file).  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib'


@enzyme69
Copy link
Author

enzyme69 commented Dec 1, 2023

In my case my Stripe is image ( I don't understand name and seed, how to setup properly), -- but I believe it will be doing image 2 image, but I have zero generation so far.


1/1
Prompt: impressionist painting apple on table 123454, impressionist painting IMG_4087, impressionist painting IMG_4087, impressionist painting IMG_4087, man and corgi portrait. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form
Negative Prompt: anime, photorealistic, 35mm film, deformed, low contrast, noisy
Load: img2img/vid2img Model
Conversion Model:  stabilityai/sdxl-turbo
The config attributes {'feature_extractor': [None, None], 'image_encoder': [None, None]} were passed to StableDiffusionXLImg2ImgPipeline, but are not expected and will be ignored. Please verify your model_index.json configuration file.
Keyword arguments {'feature_extractor': [None, None], 'image_encoder': [None, None]} are not expected by StableDiffusionXLImg2ImgPipeline and will be ignored.
Loading pipeline components...:  29%|████████████████████████████████████▌                                                                                           | 2/7 [00:00<00:00, 10.21it/s]The config attributes {'attention_type': 'default', 'dropout': 0.0, 'reverse_transformer_layers_per_block': None} were passed to UNet2DConditionModel, but are not expected and will be ignored. Please verify your config.json configuration file.
Loading pipeline components...: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:01<00:00,  5.26it/s]
Seed: 123454
Process: Image to Image
Token indices sequence length is longer than the specified maximum sequence length for this model (132 > 77). Running this sequence through the model will result in indexing errors
The following part of your input was truncated because CLIP can only handle sequences up to 77 tokens: ['captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form']
Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3636, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3636, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA eTraceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 4120, in execute
    sequencer.generate_image()
  File "/Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3636, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Location: /Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py:113

Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 4120, in execute
    sequencer.generate_image()
  File "/Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3636, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Location: /Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py:113


@tin2tin
Copy link
Owner

tin2tin commented Dec 1, 2023

Yeah, for some reason it still tries to insist on using CUDA. I tried something and updated the Mac branch. Try to redownload it.

That error with sound file installation, I'll have to investigate. But lets first try to see if that CUDA problem is solvable.

@enzyme69
Copy link
Author

enzyme69 commented Dec 1, 2023

maybe just turn off torch cuda thing?

sdxl turbo PINOKIO:

import gradio as gr
from diffusers import AutoPipelineForText2Image, AutoPipelineForImage2Image
from diffusers.utils import load_image
import torch

if torch.cuda.is_available():
  device = "cuda"
elif torch.backends.mps.is_available():
  device = "mps"
else:
  device = "cpu"


pipes = {
  "txt2img": AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16").to(device),
  "img2img": AutoPipelineForImage2Image.from_pretrained("stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16").to(device)
}

if device == "cpu":
  pipes["txt2img"].enable_model_cpu_offload()
  pipes["img2img"].enable_model_cpu_offload()


def run(prompt, image):
  print(f"prompt={prompt}, image={image}")
  if image is None:
    return pipes["txt2img"](prompt=prompt, num_inference_steps=1, guidance_scale=0.0).images[0]
  else:
    image = image.resize((512,512))
    print(f"img2img image={image}")
    return pipes["img2img"](prompt, image=image, num_inference_steps=3, strength=0.79, guidance_scale=0.1).images[0]

demo = gr.Interface(
    run,
    inputs=[
      gr.Textbox(label="Prompt"),
      gr.Image(type="pil")
    ],
    outputs=gr.Image(width=512,height=512),
    live=True
)
#demo.dependencies[0]["show_progress"] = "minimal"
demo.launch()

@tin2tin
Copy link
Owner

tin2tin commented Dec 1, 2023

Cool. Thank you. I didn't know about mps on mac. Try now.
(I'll have to go, will check back soonish)

@tin2tin
Copy link
Owner

tin2tin commented Dec 1, 2023

Back. Did that solve it?

@enzyme69
Copy link
Author

enzyme69 commented Dec 1, 2023

The idea is to have at least SDXL turbo to run. I am not a coder myself so I don't know what's missing. Yes on macOS it's all CPU, slower than NVIdia GPU, but not bad.

@tin2tin
Copy link
Owner

tin2tin commented Dec 1, 2023

Did you check the latest version?

@enzyme69
Copy link
Author

enzyme69 commented Dec 2, 2023

Latest version, new error:

Info: Installing: bark module.
Info: Installing: diffusers module.
Info: Installing: tensorflow module.
Info: Installing: soundfile module.
Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 578, in import_module
    subprocess.call([python_exe, "import ", packageName])
NameError: name 'packageName' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/soundfile.py", line 267, in <module>
    _snd = _ffi.dlopen('sndfile')
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: ctypes.util.find_library() did not manage to locate a library called 'sndfile'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 866, in execute
    install_modules(self)
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 710, in install_modules
    import_module(self, "soundfile", "PySoundFile")
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 607, in import_module
    exec("import " + module)
  File "<string>", line 1, in <module>
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/soundfile.py", line 276, in <module>
    _snd = _ffi.dlopen(_os.path.join(
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib, 0x0002): tried: '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file).  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Applications/Blender.app/Contents/Resources/3.6/python/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib'

2023-12-03 03:04:55.102 Blender[44352:2281090] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.

@enzyme69
Copy link
Author

enzyme69 commented Dec 2, 2023

Also:

Seed: 123454
Process: Image to Image
Token indices sequence length is longer than the specified maximum sequence length for this model (161 > 77). Running this sequence through the model will result in indexing errors
The following part of your input was truncated because CLIP can only handle sequences up to 77 tokens: ['loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form']
Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3647, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3647, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA eTraceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 4131, in execute
    sequencer.generate_image()
  File "/Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3647, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Location: /Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py:113

Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 4131, in execute
    sequencer.generate_image()
  File "/Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3647, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 859, in __call__
    ) = self.encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py", line 332, in encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Location: /Applications/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py:113



@tin2tin
Copy link
Owner

tin2tin commented Dec 2, 2023

Yes, the soundfile I haven't looked into, but what happens when you try to generate something?

@enzyme69
Copy link
Author

enzyme69 commented Dec 2, 2023

Above was install, below is when executing also failed:

... truncatedLoad: img2img/vid2img Model
Conversion Model:  runwayml/stable-diffusion-v1-5
model_index.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 541/541 [00:00<00:00, 1.86MB/s]
text_encoder/config.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 617/617 [00:00<00:00, 953kB/s]
tokenizer/tokenizer_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 806/806 [00:00<00:00, 843kB/s]
scheduler/scheduler_config.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 308/308 [00:00<00:00, 1.32MB/s]
safety_checker/config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.72k/4.72k [00:00<00:00, 16.1MB/s]
unet/config.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 743/743 [00:00<00:00, 5.59MB/s]
vae/config.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 547/547 [00:00<00:00, 9.48MB/s]
diffusion_pytorch_model.fp16.safetensors: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 167M/167M [00:56<00:00, 2.98MB/s]
model.fp16.safetensors: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 246M/246M [01:03<00:00, 3.86MB/s]
model.fp16.safetensors: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 608M/608M [02:07<00:00, 4.77MB/s]
diffusion_pytorch_model.fp16.safetensors: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.72G/1.72G [03:30<00:00, 8.18MB/s]
Fetching 15 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 15/15 [03:31<00:00, 14.11s/it]
Loading pipeline components...:  14%|██████████████████▊                                                                                                                 | 1/7 [00:00<00:00,  6.63it/s]`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.██████████████████████████| 1.72G/1.72G [03:30<00:00, 13.6MB/s]
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["bos_token_id"]` will be overriden.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["eos_token_id"]` will be overriden.
Loading pipeline components...: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 11.91it/s]
Seed: 123454
Process: Image to Image
Token indices sequence length is longer than the specified maximum sequence length for this model (161 > 77). Running this sequence through the model will result in indexing errors
The following part of your input was truncated because CLIP can only handle sequences up to 77 tokens: ['loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form. loose brushwork, vibrant color, light and shadow play, captures feeling over form']
Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3657, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py", line 674, in __call__
    prompt_embeds = self._encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py", line 338, in _encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Error: Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.6/scripts/addons/Pallaidium-Pallaidium_MacOS/__init__.py", line 3657, in execute
    image = converter(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py", line 674, in __call__
    prompt_embeds = self._encode_prompt(
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py", line 338, in _encode_prompt
    text_input_ids.to(device),
  File "/Users/jimmygunawan/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled



@enzyme69
Copy link
Author

enzyme69 commented Dec 2, 2023

Maybe Dream Texture addon install can show the way:
https://github.com/carson-katri/dream-textures

@tin2tin
Copy link
Owner

tin2tin commented Dec 2, 2023

Question is if something special needs to be done on a Mac to install torch.

@enzyme69
Copy link
Author

enzyme69 commented Dec 2, 2023

@enzyme69
Copy link
Author

enzyme69 commented Dec 2, 2023

Could this also help?
https://g.co/bard/share/f8b1565bb26e

@tin2tin
Copy link
Owner

tin2tin commented Dec 2, 2023

If you potentially have a lot of old python modules installed, try Uninstall Dependencies. Restart Blender Install Dependencies. If it is using cached versions, search the closed issues here for torch and there is a big thread on how to manually remove python modules completely.

@enzyme69
Copy link
Author

enzyme69 commented Dec 3, 2023

I don't quite mess with that, but usually this is done from the addon install requirements?

Anyhow, I think the module isn't properly installed, but I know Dream Texture works on macOS, but slightly slow.

A better way is if Palladium connect to ComfyUI -- as server backend. I have ComfyUI working and fast.

@tin2tin
Copy link
Owner

tin2tin commented Dec 3, 2023

If you want to check the python version, get this add-on and hit the list button:
https://github.com/amb/blender_pip

image

@enzyme69
Copy link
Author

enzyme69 commented Dec 7, 2023

Python Module Manager list:
Screenshot 2023-12-07 at 11 25 00 am
Screenshot 2023-12-07 at 11 25 11 am
Screenshot 2023-12-07 at 11 25 06 am


btw:
Apple just release "mlx" and probably can install stable diffusion this way via its mlx module?
https://github.com/ml-explore/mlx

Alternatively, I still think the ComfyUI backend is worth testing on your side:

  1. ComfyUI server running and can generate (also with custom workflow)
  2. Pallaidium could pull images from generated AI.
  3. Simpler?

@enzyme69
Copy link
Author

enzyme69 commented Dec 7, 2023

In your script, can you just "turn off CUDA" because macOS stable diffusion uses something else?

Like cpu only?

@tin2tin
Copy link
Owner

tin2tin commented Dec 8, 2023

We tried a few things, and apparently they do not solve the problems, so, I'm sorry, there is no way I can try to solve the Mac problems without having a Mac, and for that reason I'll have to close this report as it is unsupported.

@tin2tin tin2tin closed this as completed Dec 8, 2023
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

2 participants