TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Generate images in one second on your Mac using a latent consistency model

215 pointsby bfirshover 1 year ago

17 comments

herpdyderpover 1 year ago
32GB M1 Max is taking 25 seconds on the exact same prompt as in the example.<p>Edit: it seems the &quot;per second&quot; requires the `--continuous` flag to bypass the initial startup time. With that, I&#x27;m now seeing the ~1 second per image time (if initial startup time is ignored).
评论 #38041605 未加载
m3kw9over 1 year ago
Everytime i execute: python main.py \ &quot;a beautiful apple floating in outer space, like a planet&quot; \ --steps 4 --width 512 --height 512<p>It redownloads 4 gigs worth of stuff every execution. Can&#x27;t you have the script save, and check if its there, then download it or am I doing something wrong?
评论 #38044871 未加载
评论 #38043001 未加载
simple10over 1 year ago
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&#x27;ll be doing this weekend... generating artwork for my 9 yo kid&#x27;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?
评论 #38042637 未加载
评论 #38042516 未加载
naetover 1 year ago
Well, how do they look? I&#x27;ve seen some other image generation optimizations, but a lot of them make a significant tradeoff in reduced quality.
oldstrangersover 1 year ago
Interesting timing because part of me thinks Apple&#x27;s Spooky Fast event has to do with generative AI.
评论 #38041355 未加载
评论 #38041621 未加载
hackthemackover 1 year ago
If you want to run this on a linux machine and use the machine&#x27;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=&quot;cpu&quot;, torch_dtype=torch.float32).to(&#x27;cpu:0&#x27;)<p>Basically change the backend from mps to cpu
评论 #38043200 未加载
zorgmonkeyover 1 year ago
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:&#x2F;&#x2F;download.pytorch.org&#x2F;whl&#x2F;cu121" rel="nofollow noreferrer">https:&#x2F;&#x2F;download.pytorch.org&#x2F;whl&#x2F;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&lt;00:00, 9.43it&#x2F;s] and used 4.6GB of VRAM.
agloe_dreamsover 1 year ago
This....but a menu item that does it for you.
评论 #38041961 未加载
评论 #38041637 未加载
tobrover 1 year ago
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.
评论 #38042536 未加载
评论 #38043836 未加载
评论 #38042527 未加载
LauraMediaover 1 year ago
Thought it was too good to be true, tried it with an M2 Pro MacBook Pro.<p>Generation takes 20-40 seconds, when using &quot;--continuous&quot; it takes 20-40 seconds once and then keeps generating every 3-5 seconds.
评论 #38046160 未加载
simple10over 1 year ago
Does anyone know of other image generation models that run well on a M1&#x2F;M2 mac laptop?<p>I&#x27;d like do to some comparison testing. The model in the post is fast but results are hit or miss for quality.
评论 #38042865 未加载
评论 #38043098 未加载
m3kw9over 1 year ago
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
评论 #38043182 未加载
firechickenbirdover 1 year ago
Quality of these LCM is not the best though
评论 #38042668 未加载
latchkeyover 1 year ago
The speed is impressive, but the output is honestly not. It feels like DALLE3 is light years ahead of it.
评论 #38047438 未加载
ForkMeOnTinderover 1 year ago
Why bother with the safety checker if the model is running locally? I wonder how much faster it would be if the safety checks were skipped.
评论 #38042743 未加载
评论 #38042164 未加载
评论 #38042810 未加载
评论 #38043276 未加载
评论 #38042275 未加载
评论 #38042299 未加载
grandpa_yetiover 1 year ago
Seeing this kind of image generation limited to M series Macs just goes to show how far ahead Apple is in the notebook GPU game.
评论 #38041246 未加载
评论 #38041307 未加载
评论 #38041227 未加载
评论 #38042194 未加载
评论 #38042214 未加载
评论 #38042219 未加载
评论 #38042009 未加载
评论 #38041275 未加载
AIorNotover 1 year ago
Awesome