r/StableDiffusion • u/vjb_reddit_scrap • Aug 24 '22
I made a Step By Step Guide to run Stable Diffusion the official way on Google Colab
If anyone here struggling to get Stable Diffusion working on Google Colab or want to try the official library from HuggingFace called diffusers to generate both txt2img and img2img, I've made a guide for you.
You can even Enable NSFW if you want.
The guide is absolutely free and can be accessed here.
If the article really helped you and you wish to support me, you can buy the article for whatever price you want from here. Either way, the article you get is the same, it's completely your wish to buy it or access it for free.
4
u/brown2green Aug 24 '22
This helped a lot, thanks. Finally I could get to try
img2img.1
u/dumbdreamed Aug 24 '22
I really appreciate it but it gives me this error: name 'pipe' is not defined
1
u/Coffeera Aug 26 '22 edited Aug 26 '22
Hey, everything works great for me, even though I have no idea what I was doing. Thank you for the tutorial!I'm just wondering, is it possible to see the seed for my generated images?
Edit: I ran into a little bit of trouble. Everything works fine, but when I try to view individual images, it always shows the same image.
1
u/[deleted] Sep 01 '22
Is there some explanation somewhere of what hugging face actually does? (is it just a pertained version of the network?)
2
u/wanderingsanzo Aug 24 '22
I've managed to finally get Stable Diffusion working thanks to this tutorial! Thank you so much!!!
2
u/Illustrious_Row_9971 Aug 24 '22
web demo for stable diffusion: https://huggingface.co/spaces/stabilityai/stable-diffusion
google colab with a gui to share and run in the browser: https://colab.research.google.com/drive/1NfgqublyT_MWtR5CsmrgmdnkWiijF3P3?usp=sharing
2
u/CaptainBlackk Aug 24 '22
I didn't get the prompt for hugging face token, is that ok? I mounted the drive as cache, not sure what i'm doing.
1
u/TheMightyKutKu Aug 24 '22 edited Aug 24 '22
thanks a lot! slower than than my main computer but much better than my laptop!
Although how do I empty the GPU VRAM? Do I have to restart the whole session?
1
u/harderisbetter Aug 25 '22
Thanks fam!
1
u/balille Aug 28 '22
The img2img part is intriguing. I could upload an image, but I'm not sure what do to then.
On my screen, it says:
from torch import autocast
prompt = "astronaut_rides_horse.png"
with autocast("cuda"):
image = pipe(prompt)["sample"][0] # image here is in [PIL format](https://pillow.readthedocs.io/en/stable/)
Manually hitting enter after the main prompt, then adding path_to_input_image = (or a colon without a blank as in your screenshot), then the copied path in quotes didn't work. Sorry if this is naive, but do I have to install the img2img thing separately?
1
u/Modorok666 Sep 06 '22
Thank you! Thinking about moving to SD from MJ, because of the censorship
1
u/Haunting_Fox6513 May 19 '23
i had this running now for a while and suddenly when the programm sets up the environment it has a problem with the git clone line and it returns non-zero exit status 128
any solutions?
-1
u/[deleted] Aug 24 '22
Colab trying to look as bad as possible to discourage mfs๐
3
u/[deleted] Aug 24 '22
[removed] โ view removed comment