stable-diffusion-videos
stable-diffusion-videos copied to clipboard
The code cannot run normally on M1 Mac. Please help me, thank you
I executed this code on the mac of M1
from stable_diffusion_videos import StableDiffusionWalkPipeline, Interface
import torch
pipeline = StableDiffusionWalkPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4",
torch_dtype=torch.float32,
revision="fp16",
).to("mps")
interface = Interface(pipeline)
interface.launch()
and then reported the following error after clicking submit in the browser. I don't know how to modify it.
Remove revision='fp16'
and try again
Thank you for your reply
I removed revision='fp16 'and reported the following error
Is it possible to run this on a M1 mac? Otherwise I can skip the paid resources!!
I get this error when running
Cannot initialize model with low cpu memory usage because `accelerate` was not found in the environment. Defaulting to `low_cpu_mem_usage=False`. It is strongly recommended to install `accelerate` for faster and less memory-intense model loading. You can do so with:
pip install accelerate
.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
Traceback (most recent call last):
File "/Users/quintendewilde/test.py", line 4, in <module>
pipeline = StableDiffusionWalkPipeline.from_pretrained(
File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/diffusers/pipeline_utils.py", line 270, in to
module.to(torch_device)
File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/nn/modules/module.py", line 1145, in to
return self._apply(convert)
File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/nn/modules/module.py", line 797, in _apply
module._apply(fn)
File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/nn/modules/module.py", line 820, in _apply
param_applied = fn(param)
File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/nn/modules/module.py", line 1143, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File "/Users/quintendewilde/Library/Python/3.9/lib/python/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
@nateraw you have any idea?
I do not have a M1 machine so I have no way of debugging/reproducing any issues here or fixing them :(. If someone with an M1 wants to help, it would be much appreciated.
@quintendewilde The first part of your message is just a warning, afaik. The second part looks like something was trying to get set to a cuda device, which would fail on M1. Did you run similar code as OP? If not, please send what you were running.
this one is working for me
pipeline = StableDiffusionWalkPipeline.from_pretrained( "CompVis/stable-diffusion-v1-4", torch_dtype=torch.float32, )
@dnztsdzn Thanks it works for me too. I still get the black images because it thinks it's creating things that are "not allowed". Can I do something about this @nateraw
Thanks for the help!