6 ms·
If you have a GPU with >4GB of VRAM and you want to run this locally, here's a fork of the Stable Diffusion repo with a convenient web UI: https://github.com/h
by comex 4y ago
If you have a GPU with >4GB of VRAM and you want to run this locally, here's a fork of the Stable Diffusion repo with a convenient web UI:
https://github.com/hlky/stable-diffusion https://github.com/hlky/stable-diffusion
It supports both txt2img and img2img. (Not affiliated.)
Edit: Incidentally, I tried running it on a CPU. It is possible, but it took 3 minutes instead of 10 seconds to produce an image. It also required me to hack up the script in a really gross way. Perhaps there is a script somewhere that properly supports this.
- nickthegreek 4y agoGot this working on my 8gb 3070. 7-8s per image with default settings. Thanks for posting this!
- acidburnNSA 4y agoJust tried it on Ubuntu 22.04. And it's working! Had to install python-is-python3 and conda, but it's up now. Fun, thanks.
- TuringTest 4y agoHow do you set up the model? Instructions only say "Download the model checkpoint. (e.g. from huggingface)", but I can't find instructions there on how to find a ckpt file, nor exactly what file should I look for.
- nilsb 4y agoYou'll need this file: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/blob/main/sd-v1-4.ckpt https://huggingface.co/CompVis/stable-diffusion-v-1-4-origin... - Before you can download it you have to accept the T&C at https://huggingface.co/CompVis/stable-diffusion-v-1-4-original https://huggingface.co/CompVis/stable-diffusion-v-1-4-origin...
- nickthegreek 4y agoThank you, this saved me a lot of frustration.
- jtolmar 4y agoI'm impressed that running it on CPU only made it ~20x slower. How did you do it?
- lkois 4y agoNah that's normal. It's why GPUs are the usual thing for AI. Any crap, old, weak gpu with 4gb memory would run circles around a cpu It's often easier to actually get models to run on CPU, due to simpler install configs and more available memory. Just painful to get a result out of it. Which might help keep the install simple, because it's not even worth optimizing
- kgwgk 4y ago> Any crap, old, weak gpu with 4gb memory would run circles around a cpu Not really. https://news.ycombinator.com/item?id=32635086 https://news.ycombinator.com/item?id=32635086 I’m not even sure it works well - if at all - with 4Gb. In any case, it’s impressive even if it takes minutes. And it’s not like you need to be there to make it work. You can create a list of prompts, let it do its thing and check the results later.
- hwers 4y agoI have 4 gb and it takes about 9 seconds for me :) (Tho at 448x448 but there’s no real difference in quality.)
- kgwgk 4y agoGood to know it works. That’s not a crap, old, weak gpu, I guess. I’ve not tried that size but I tried 256x256 and it was too small to get interesting results - maybe there are some parameters that can be adjusted to improve it though.
- stavros 4y agoThe GP is asking why it's only 20x slower, rather than more slow.
- asicsp 4y agoCan you share your script for running on CPU?
- ArneBab 4y agopython optimizedSD/optimized_txt2img.py --device cpu --precision full --prompt "…" --H 512 --W 512 --n_iter 1 --n_samples 1 --ddim_steps 50
- asicsp 4y agoThank you. There was a also a related submission for running on CPU: https://news.ycombinator.com/item?id=32642255 https://news.ycombinator.com/item?id=32642255 I'm planning to try it out this weekend. But not really hopeful. I only have 8GB ram, and mine is a cheap Intel CPU that doesn't even have AVX.
- MichaelDickens 4y agoWhat kind of GPU do you have? It takes several minutes to produce an image on my 1070.
- stingraycharles 4y agoA 1070 isn’t very powerful for ML compared to more recent GPUs, so several minutes sounds about right.
- elaus 4y agoTakes 3 minutes (for a prompt resulting in a set of 4 images) on my 1080 as well. Really astonished that it takes GP about the same time using just a CPU. Seems like the older generation of GPUs isn't much better than CPUs in regards to ML stuff.
- krisoft 4y ago> Really astonished that it takes GP about the same time using just a CPU. GP talks about generating a single image while you talk about generating 4.
- SirYandi 4y agoTo add another data point, my GTX1080 takes ~60 sec to generate a pair of 500x500 images using txt2img. Haven't tried img2img yet as the UI package I went with is a bit buggy with it
- anhner 4y agoalso on a 1070, I can generate an image in ~15 seconds, surely you're doing something wrong.
- freeqaz 4y agoWhat settings are you using it the people with 1080s above you are taking 3 minutes?
- 4y ago
- kgwgk 4y agoThere are as well forks for the GPU in Apple’s M1 chips: https://github.com/magnusviri/stable-diffusion https://github.com/magnusviri/stable-diffusion
- francisduvivier 4y agoAnyone knows how fast this runs on an m1 macbook air?
- bjtitus 4y agoTakes anywhere from 30s-1.5m on my M1 Max.
- deleted 4y ago[deleted]
- bambax 4y agoWhat are good and reasonably priced GPUs for this (<$250, possibly less)?
- simcop2387 4y agoNot sure exact pricing but look for a used maxwell (geforce 1000 series) nvidia gpu i'd bet. A quadro m2000 with 4gb of ram was about 100 on ebay a short bit ago
- bambax 4y agoThanks! A Quadro m2000 can still be found fr around 100 today, but I found an m4000 for 150, and ordered that... We'll see...
- ilaksh 4y agoAmazing. Anyone know of a fork where this is hosted on a cloud GPU? Or any existing hosting of this?
- fragmede 4y agoThere’s a Colab implementation (Google hosted GPU) linked to from https://www.youtube.com/watch?v=Xur1JeRjjOI https://www.youtube.com/watch?v=Xur1JeRjjOI
- outdoorblake 4y agohere is a serverless GPU template for Stable Diffusion hosted on Banana's cloud platform. template: https://github.com/bananaml/serverless-template-stable-diffusion/ https://github.com/bananaml/serverless-template-stable-diffu... setup demo: https://www.banana.dev/blog/how-to-deploy-stable-diffusion-to-production https://www.banana.dev/blog/how-to-deploy-stable-diffusion-t...
- BatteryMountain 4y agoNvidia GTX 1660 Super with 6GB of VRAM. I do runs at 384px by 384px, with batch size of 1. Sampling method has almost no impact on memory. Using k_euler with 30 steps renders an image in 10 to 20 seconds. The biggest thing that affect rending speed is the steps and the resolution, so 512x512 with C 50 using ddim is much slower than 256x256 with C 25 using k_euler. The sampling methods run mostly in the same timelines, but the k_euler one can produce viable output at lower C values, meaning it is faster than the rest. Don't add gfpgan in the same pipeline, as it takes more vram. I'm running it on Windows 10 with latest drivers. I set the python process to Realtime priority in task manager (makes a slight difference!). Have not tried it on Linux.
- gitfan86 4y agoI'm running 1660 ti on Windows 11. I'm thinking about getting a 3090 so that I can make higher resolution images. Gfpgan runs much faster for me 5 seconds per picture
- machineleaning 4y agoWhat resolution could you get on a 3090?
- gitfan86 4y agoNo idea, things are changing very quickly now
- BatteryMountain 4y agoGood way to know (if not found online) is to start at 512x512 if you have a card with 12GB VRAM and try to increment it (the ui slider increases it by 64px for each increment) and backtrack when you start getting "cuda out of memory" errors. I've seen some renders on discord where the sizes are well above 1000px, so they must have had a 16/24GB cards or something similar. In the research context, they are used to using 40GB/80GB hardware (and perhaps multiples) to train and render. So quite remarkable that it works on consumer hardware at this point. edit: on second thought, they most likely rendered at 512px but then ran it through an upscaler model. I've been meaning to hook mine up but kinda forgot to try.