stable-diffusion-videos icon indicating copy to clipboard operation
stable-diffusion-videos copied to clipboard

The code cannot run normally on M1 Mac. Please help me, thank you

Open zdw19840929 opened this issue 1 year ago • 8 comments

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. 截屏2023-03-15 13 46 30

zdw19840929 avatar Mar 15 '23 05:03 zdw19840929

Remove revision='fp16' and try again

nateraw avatar Mar 16 '23 16:03 nateraw

Thank you for your reply I removed revision='fp16 'and reported the following error 截屏2023-03-21 13 33 49

zdw19840929 avatar Mar 21 '23 05:03 zdw19840929

Is it possible to run this on a M1 mac? Otherwise I can skip the paid resources!!

naokikano avatar Apr 15 '23 18:04 naokikano

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

quintendewilde avatar Apr 23 '23 15:04 quintendewilde

@nateraw you have any idea?

quintendewilde avatar May 14 '23 18:05 quintendewilde

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.

nateraw avatar May 15 '23 22:05 nateraw

this one is working for me

pipeline = StableDiffusionWalkPipeline.from_pretrained( "CompVis/stable-diffusion-v1-4", torch_dtype=torch.float32, )

dnztsdzn avatar May 17 '23 00:05 dnztsdzn

@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!

quintendewilde avatar May 19 '23 14:05 quintendewilde