HVision-NKU / StoryDiffusion

Create Magic Story!
Apache License 2.0
5.45k stars 519 forks source link

Error in MPS version , M3, 16G #56

Closed scottonly2 closed 1 month ago

scottonly2 commented 2 months ago

Getting the following error with [Unstable][a little puppy with big eyes][Japanese Anime] Comic Descrptions: [puppy standing next to a pond] File "..../miniconda3/envs/storydiffusion/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "..../miniconda3/envs/storydiffusion/lib/python3.10/site-packages/diffusers/models/attention_processor.py", line 522, in forward return self.processor( File "..../ml_ps/StoryDiffusion/gradio_app_sdxl_specific_id_mps.py", line 137, in call hidden_states = self.call1(attn, hidden_states,encoder_hidden_states,attention_mask,temb) File "...../ml_ps/StoryDiffusion/gradio_app_sdxl_specific_id_mps.py", line 197, in call1 hidden_states = F.scaled_dot_product_attention( RuntimeError: The size of tensor a (576) must match the size of tensor b (1152) at non-singleton dimension 3

kellyzxiaowei commented 2 months ago

Getting the following error with [Unstable][a little puppy with big eyes][Japanese Anime] Comic Descrptions: [puppy standing next to a pond] File "..../miniconda3/envs/storydiffusion/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, kwargs) File "..../miniconda3/envs/storydiffusion/lib/python3.10/site-packages/diffusers/models/attention_processor.py", line 522, in forward return self.processor( File "..../ml_ps/StoryDiffusion/gradio_app_sdxl_specific_id_mps.py", line 137, in call hidden_states = self.call1(attn, hidden_states,encoder_hidden_states,attention_mask,temb) File "...../ml_ps/StoryDiffusion/gradio_app_sdxl_specific_id_mps.py", line 197, in call1** hidden_states = F.scaled_dot_product_attention( RuntimeError: The size of tensor a (576) must match the size of tensor b (1152) at non-singleton dimension 3

I'm using a Python-created virtual environment, you can try it out. git clone https://github.com/HVision-NKU/StoryDiffusion cd /path your/StoryDiffusion python3.11 -m venv StoryDiffusion conda deactivate source /path your/StoryDiffusion/StoryDiffusion/bin/activate

pip install --upgrade pip pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu python -m pip install --no-binary :all: numpy python -m pip install "diffusers[torch]" python -m pip install tensorflow tensorflow-metal python -m pip install onnxruntime onnxruntime-silicon python -m pip install jax-metal python -m pip install mlx coremltools