32GB M1 Max is taking 25 seconds on the exact same prompt as in the example.<p>Edit: it seems the "per second" requires the `--continuous` flag to bypass the initial startup time. With that, I'm now seeing the ~1 second per image time (if initial startup time is ignored).
Everytime i execute: python main.py \
"a beautiful apple floating in outer space, like a planet" \
--steps 4 --width 512 --height 512<p>It redownloads 4 gigs worth of stuff every execution. Can't you have the script save, and check if its there, then download it or am I doing something wrong?
This is awesome! It only takes a few minutes to get installed and running. On my M2 mac, it generates sequential images in about a second when using the continuous flag. For a single image, it takes about 20 seconds to generate due to the initial script loading time (loading the model into memory?).<p>I know what I'll be doing this weekend... generating artwork for my 9 yo kid's video game in Game Maker Studio!<p>Does anyone know any quick hacks to the python code to sequentially prompt the user for input without purging the model from memory?
If you want to run this on a linux machine and use the machine's cpu.<p>Follow the instructions. Before actually running the command to generate an image.<p>Open up main.py
Change line 17 to
model.to(torch_device="cpu", torch_dtype=torch.float32).to('cpu:0')<p>Basically change the backend from mps to cpu
It is very easy to tweak this to generate images quickly on a nvidia GPU:<p>* after `pip install -r requirements.txt` do `pip3 install torch torchvision torchaudio xformers --index-url <a href="https://download.pytorch.org/whl/cu121" rel="nofollow noreferrer">https://download.pytorch.org/whl/cu121</a>`<p>* on line 17 of main.py change torch.float32 to torch.float16 and change mps:0 to cuda:0<p>* add a new line after 17 `model.enable_xformers_memory_efficient_attention()`<p>The xFormers stuff is optional, but it should make it a bit faster.
For me this got it generating images in less than second [00:00<00:00, 9.43it/s] and used 4.6GB of VRAM.
What will be possible to do once these things run at interactive frame rates? It’s a little mind boggling to think about what types of experiences this will allow not so long from now.
Thought it was too good to be true, tried it with an M2 Pro MacBook Pro.<p>Generation takes 20-40 seconds, when using "--continuous" it takes 20-40 seconds once and then keeps generating every 3-5 seconds.
Does anyone know of other image generation models that run well on a M1/M2 mac laptop?<p>I'd like do to some comparison testing. The model in the post is fast but results are hit or miss for quality.
Is fast but only if you go 512 512 res will generate an image from start script to finish in 5 seconds, but if you up it to 1024 it takes 10x as long<p>This on an M2 Max 32gb