ml-stable-diffusion
ml-stable-diffusion copied to clipboard
Generated images are constantly blank
What happened?
I downloaded the Model Checkpoints from huggingface and run the inference command but everytime either the output is completely blank or something like the image below
Tech details
Chip: Apple M2
Memory: 8GB
OS: 13.1 Beta (22C5059b)
pip list
Package Version Editable project location
------------------------------ ---------- ----------------------------------------------------------
accelerate 0.15.0
certifi 2022.9.24
charset-normalizer 2.1.1
coremltools 6.1
diffusers 0.9.0
filelock 3.8.0
huggingface-hub 0.11.1
idna 3.4
importlib-metadata 5.1.0
mpmath 1.2.1
numpy 1.23.5
packaging 21.3
Pillow 9.3.0
pip 22.3.1
protobuf 3.20.3
psutil 5.9.4
pyparsing 3.0.9
python-coreml-stable-diffusion 0.1.0 /...
PyYAML 6.0
regex 2022.10.31
requests 2.28.1
scipy 1.9.3
setuptools 65.5.1
sympy 1.11.1
tokenizers 0.13.2
torch 1.12.0
tqdm 4.64.1
transformers 4.25.1
typing_extensions 4.4.0
urllib3 1.26.13
wheel 0.38.4
zipp 3.11.0
python -m python_coreml_stable_diffusion.pipeline --prompt "a photo of an astronaut riding a horse on mars" -i models/coreml-stable-diffusion-v1-4_original_packages -o output --compute-unit CPU_AND_NE --num-inference-steps 50
INFO:__main__:Setting random seed to 93
INFO:__main__:Initializing PyTorch pipe for reference configuration
Fetching 16 files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 17467.17it/s]
INFO:__main__:Removed PyTorch pipe to reduce peak memory consumption
INFO:__main__:Loading Core ML models in memory from models/coreml-stable-diffusion-v1-4_original_packages
INFO:python_coreml_stable_diffusion.coreml_model:Loading text_encoder mlpackage
INFO:python_coreml_stable_diffusion.coreml_model:Loading models/coreml-stable-diffusion-v1-4_original_packages/Stable_Diffusion_version_CompVis_stable-diffusion-v1-4_text_encoder.mlpackage
INFO:python_coreml_stable_diffusion.coreml_model:Done. Took 5.1 seconds.
INFO:python_coreml_stable_diffusion.coreml_model:Loading unet mlpackage
INFO:python_coreml_stable_diffusion.coreml_model:Loading models/coreml-stable-diffusion-v1-4_original_packages/Stable_Diffusion_version_CompVis_stable-diffusion-v1-4_unet.mlpackage
INFO:python_coreml_stable_diffusion.coreml_model:Done. Took 116.1 seconds.
INFO:python_coreml_stable_diffusion.coreml_model:Loading a CoreML model through coremltools triggers compilation every time. The Swift package we provide uses precompiled Core ML models (.mlmodelc) to avoid compile-on-load.
INFO:python_coreml_stable_diffusion.coreml_model:Loading vae_decoder mlpackage
INFO:python_coreml_stable_diffusion.coreml_model:Loading models/coreml-stable-diffusion-v1-4_original_packages/Stable_Diffusion_version_CompVis_stable-diffusion-v1-4_vae_decoder.mlpackage
INFO:python_coreml_stable_diffusion.coreml_model:Done. Took 7.3 seconds.
INFO:python_coreml_stable_diffusion.coreml_model:Loading safety_checker mlpackage
INFO:python_coreml_stable_diffusion.coreml_model:Loading models/coreml-stable-diffusion-v1-4_original_packages/Stable_Diffusion_version_CompVis_stable-diffusion-v1-4_safety_checker.mlpackage
INFO:python_coreml_stable_diffusion.coreml_model:Done. Took 2.2 seconds.
INFO:__main__:Done.
INFO:__main__:Initializing Core ML pipe for image generation
INFO:__main__:Stable Diffusion configured to generate 512x512 images
INFO:__main__:Done.
INFO:__main__:Beginning image generation.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 51/51 [00:35<00:00, 1.44it/s]
INFO:__main__:Generated image has nsfw concept=False
INFO:__main__:Saving generated image to output/a_photo_of_an_astronaut_riding_a_horse_on_mars/randomSeed_93_computeUnit_CPU_AND_NE_modelVersion_CompVis_stable-diffusion-v1-4.png