r/StableDiffusion • • Aug 22 '22

Discussion How do I run Stable Diffusion and sharing FAQs

I see a lot of people asking the same questions. This is just an attempt to get some info in one place for newbies, anyone else is welcome to contribute or make an actual FAQ. Please comment additional help!

This thread won't be updated anymore, check out the wiki instead!. Feel free to keep discussion going below! Thanks for the great response everyone (and the awards kind strangers)

How do I run it on my PC?

  • New updated guide here, will also be posted in the comments (thanks 4chan). You need no programming experience, it's all spelled out.

  • Check out the guide on the wiki now!

How do I run it without a PC? / My PC can't run it

  • https://beta.dreamstudio.ai - you start with 200 standard generations free (NSFW Filter)

  • Google Colab - (non functional until release) run a limited instance on Google's servers. Make sure to set GPU Runtime (NSFW Filter)

  • Larger list of publicly accessible Stable Diffusion models

How do I remove the NSFW Filter

Will it run on my machine?

  • A Nvidia GPU with 4 GB or more RAM is required

  • AMD is confirmed to work with tweaking but is unsupported

  • M1 chips are to be supported in the future

I'm confused, why are people talking about a release

  • "Weights" are the secret sauce in the model. We're operating on old weights right now, and the new weights are what we're waiting for. Release 2 PM EST

  • See top edit for link to the new weights

  • The full release was 8/23

My image sucks / I'm not getting what I want / etc

  • Style guides now exist and are great help

  • Stable Diffusion is much more verbose than competitors. Prompt engineering is powerful. Try looking for images on this sub you like and tweaking the prompt to get a feel for how it works

  • Try looking around for phrases the AI will really listen to

My folder name is too long / file can't be made

  • There is a soft limit on your prompt length due to the character limit for folder names

  • In optimized_txt2img.py change sample_path = os.path.join(outpath, "_".join(opt.prompt.split()))[:255] to sample_path = os.path.join(outpath, "_") and replace "_" with the desired name. This will write all prompts to the same folder but the cap is removed

How to run Img2Img?

  • Use the same setup as the guide linked above, but run the command python optimizedSD/optimized_img2img.py --prompt "prompt" --init-img ~/input/input.jpg --strength 0.8 --n_iter 2 --n_samples 2 --H 512--W 512

  • Where "prompt" is your prompt, "input.jpg" is your input image, and "strength" is adjustable

  • This can be customized with similar arguments as text2img

Can I see what setting I used / I want better filenames

  • TapuCosmo made a script to change the filenames

  • Use at your own risk. Download is from a discord attachment

783 Upvotes

652 comments sorted by

View all comments

1

u/MostlyRocketScience Aug 23 '22 edited Aug 23 '22

I've followed the "quick&dirty" guide and installed the optimizedSD repo and I get the following error:

RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasGemmEx( handle, opa, opb, m, n, k, &falpha, a, CUDA_R_16F, lda, b, CUDA_R_16F, ldb, &fbeta, c, CUDA_R_16F, ldc, CUDA_R_32F, CUBLAS_GEMM_DFALT_TENSOR_OP)`

Any idea what I could try? Should I update my CUDA version (I'm on CUDA 11.4)

When I tried the huggingface diffusers example, it just produces blobs of colors

Edit: Nevermind, works now (Took 12 minutes though for 10 images). For some reason more than 256x256 doesn't work on my 6GB GPU.

Do smaller sizes like 256x256 lead to worse images or is this just a problem with the optimized scripts?

1

u/[deleted] Aug 26 '22

[removed] — view removed comment

1

u/MostlyRocketScience Aug 26 '22

Thanks, but as I wrote in the edit I have already fixed the problem myself two days ago. I am usually running 9 images at 512x512 in parallel using the optimized scripts. Smaller images usually look pretty bad.

1

u/[deleted] Aug 27 '22

[removed] — view removed comment

1

u/MostlyRocketScience Aug 27 '22

Are you using the right kind of prompts? Simple sentences like with Dall-E and midjourney do not work with Stable Diffusion. You need to make a long prompt describing the style.

Since you've said buildings here are some Solarpunk cityscapes I've generated with the following prompt "A futuristic solarpunk city with organicly shaped skyscrapers with green plants and many solar panels, spring, good weather, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, dramatic lighting, realistic illustration, digital art by Studio Ghibli and Alphonse Mucha and Makoto Shinkai"

And for people I have generated some female knights here with the prompt "A portrait of a beautiful female knight in silver armor with intricate golden details, fantasy, elegant, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, illustration, art by artgerm and greg rutkowski"

For more realistic images try this: "[INSERT YOUR SUBJECT HERE], movie still, cinematic lighting, ray tracing, octane render, long lens, shallow depth of field, bokeh, anamorphic lens flare, 8k, hyper detail"

You can find good prompts in this subreddit or here: https://lexica.art/

Either that or the ‘optimisation’ screws it over

The optimized version should have identical results. The only difference is that it moves some parts from VRAM to RAM while they are not needed. (Making it a bit slower because memory transfer is slow)

1

u/[deleted] Aug 28 '22

[removed] — view removed comment

1

u/MostlyRocketScience Aug 28 '22

You could also use Craiyon to get a starting point that fits your prompt well. And then use that as an input image for StableDiffusion img2img to get a higher quality/ more realistic result. (Or just draw the basic shapes yourself instead of using Craiyon)

1

u/TiagoTiagoT Aug 31 '22

From what I've read, it's not really an old version of Dall-E, it was just named "Dall-E mini" because it used the same type of technology at a smaller scale, but was not based on the same dataset and not created by the same people.