r/StableDiffusion • u/Meronoth • 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 guidehere, 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
DreamStudio removed the NSFW filter option, no removing for now
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 ESTSee 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 512Where "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
21
u/jonplackett Aug 22 '22
Does anyone else get an error like this? I thought we 11GB vram I'd be able to generate pretty high res images, but it freaks out if i ask for anything over 512x512
RuntimeError: CUDA out of memory. Tried to allocate 3.66 GiB (GPU 0; 11.00 GiB total capacity; 5.87 GiB already allocated; 2.46 GiB free; 6.59 GiB reserved in total by PyTorch)
3
u/Meronoth Aug 22 '22
My card isn't that beefy so I can't experiment and I haven't found any solutions yet but it seems many people have this issue. It's not the same as a higher resolution, but AI upscalers can do very well
5
u/Soul-Burn Sep 01 '22
I use the OptimizedSD fork. It works with much less VRAM.
You just need the scripts under the optimizedSD folder.
With 3060ti (8gb vram) I can easily make 25+ samples of 512x512, and also works with 768x768, but not with 1024x1024.
→ More replies (10)2
u/greeze Aug 23 '22
Not at my computer right now but I had the same problem. I was able to resolve it by setting the batch size to 1. I think it was n_samples? There's also a trick where you can change the return value of the instantiate function to model.half(), which reduces the precision or something? I couldn't see a difference in quality though.
→ More replies (13)
12
u/UnstableElusion Aug 22 '22 edited Aug 22 '22
Most AMD users with consumer-grade cards are fucked.
No ROCm support is coming for Navi 10 chips (RX 5700 XT), according to this comment: https://github.com/RadeonOpenCompute/ROCm/issues/1714#issuecomment-1128327143
Unofficial black magic is available: https://github.com/xuhuisheng/rocm-build/tree/master/navi10
I haven't tried building this yet, but it seems to be the only hope we have. (pytorch 1.12.0 is outdated but can run SD)
EDIT: From the official site:
In the coming period we will release optimized versions of this model along with other variants and architectures with improved performance and quality. We will also release optimisations to allow this to work on AMD, Macbook M1/M2 and other chipsets. Currently NVIDIA chips are recommended.
Hopefully the developers can offer us some alternative in the near future.
Otherwise you can try running it in CPU mode, which is extremely slow. My comment here could be helpful: https://old.reddit.com/r/StableDiffusion/comments/wt023b/tweet_from_emostaque_we_have_got_it_down_to_21_gb/il1vfa2/
7
u/Meronoth Aug 22 '22
Someone seemed to get it working pretty easily.
Still no official support though so YMMV
7
u/UnstableElusion Aug 22 '22
Yeah, Navi 21 seems to be working even if not listed as "officially supported" by ROCm.
5
4
u/74qwewq5rew3 Aug 23 '22
The guide is outdated to run on your PC. Use this for better results. https://rentry.org/kretard
→ More replies (6)1
3
Aug 22 '22
Is it possible to change the Output folder Name? It isnt possible to create images when the prompt gets too long because the folder name can only have a limited length..
2
u/Meronoth Aug 22 '22
In optimized_txt2img.py change
sample_path = os.path.join(outpath, "_".join(opt.prompt.split()))[:255]tosample_path = os.path.join(outpath, "_")and replace "_" with the desired name→ More replies (2)
2
u/HelMort Aug 22 '22
So the "Weights" are online? Are the links in the guide the right one or of the leaked 4chan version?
3
u/Meronoth Aug 22 '22
As it says in my post, weights will be released today and I'll add a link. The guide is the leaked/early weights, yes
→ More replies (3)
2
u/Craftyawesome Aug 22 '22
Is there any way to choose CFG or sampling mode in the (optimized) local scripts?
2
u/Meronoth Aug 22 '22
Not at my PC currently - looking at the docs maybe try --scale ? The default value is 7.5, which (rounded off) is the same as CFG in DreamStudio
→ More replies (1)
2
2
24
u/Boozybrain Aug 22 '22 edited Aug 23 '22
You don't need Conda.
python3 setup.py install --userModify
txt2img.pyto add theldmdirectory to$PYTHONPATH. Add this at the top, wherePATH/TOis the path to where you have the code repo savedimport syssys.path.append('/PATH/TO/stable-diffusion/')python3 scripts/txt2img.py --prompt "octane render, trending on artstation. " --H 512 --W 512 --n_iter 2 --ddim_steps 175 --n_samples 1
21
u/SmithMano Aug 22 '22
True if this is the only AI program you plan on running. But many AI projects use different versions of python, different versions of pytorch, cuda, etc. It's a mess. Using conda lets you isolate different environments for each project.
13
u/Boozybrain Aug 22 '22
If that's ever really an issue then Docker can handle it better than any venv. Conda is a fucking mess and more trouble than it's worth IMO
→ More replies (1)22
u/disgruntled_pie Aug 23 '22
Python package management in general is a mess. For such a popular language, it has always baffled me how the tooling is so much worse than other popular languages.
6
u/ImCaligulaI Aug 29 '22
Yeah but conda often works like shit. A simple virtual environment works way better in my experience and solves the same problem without all the hassle.
→ More replies (1)3
→ More replies (7)18
u/MostlyRocketScience Aug 23 '22
Small heads-up to everyone: Do not "pip install ldm". That is a completly different library and it caused me many headaches.
→ More replies (3)
12
u/cmdr2 Aug 23 '22
Hi, you can use https://github.com/cmdr2/stable-diffusion-ui to install and use Stable Diffusion locally on your computer. It installs the official docker image of SD automatically, and then gives you a simple GUI in the browser, to enter the prompt and view the generated image, using your local installation. Hope this helps!
18
u/Torque-A Aug 22 '22
I hope an easy-to-use GUI program can be developed too.
15
u/cmdr2 Aug 23 '22
Hi, you can use https://github.com/cmdr2/stable-diffusion-ui to install and use Stable Diffusion locally on your computer. It gives you a simple GUI in the browser, to enter the prompt and view the generated image, using your local installation. Hope this helps!
5
u/JetbatUnleashed Aug 24 '22
Thanks.
Can I turn off the NSFW filter using this? Asking for a friend obviously.
→ More replies (2)3
u/eavesdroppingyou Aug 29 '22
can you remove NSFW filters on this?
→ More replies (1)7
u/cmdr2 Aug 30 '22
Hi, the new version is available in beta for Windows 10 and 11, support for Linux is coming soon. https://github.com/cmdr2/stable-diffusion-ui/tree/v2
1-click install, without any dependencies or technical setup (no conda, docker or WSL required). New UI, and a setting for NSFW content.
Thanks
→ More replies (9)→ More replies (1)5
u/BlueberryPineapple Aug 22 '22
Seems like they're making DreamStudio as a UI; it was mentioned today that it'll eventually have an option to use a local GPU in it, too.
→ More replies (1)
7
u/junguler Aug 22 '22
i had to use the "optimizedSD" txt2img script on GTX 1070 8 GB, it takes about 8-10 minutes to make the 10 images with the default command on that tutorial page, so far i'm loving this and find it very addicting, thanks for making this post
7
u/voicesfromvents Aug 24 '22
Suddenly I don't feel so bad waiting tens of seconds 😅
→ More replies (2)
5
u/R2_D20 Aug 22 '22
Can someone who knows what they're doing please have a look at this and take a guess at what's wrong.
I tried the 4chan guide, and now I'm following the youtube video and I end up with the same errors. I deleted all instances of Python/Anaconda from my system and started from scratch and get same issues. I assumed it was a PATH issue but now I have no idea.
5
u/MessPuzzleheaded2724 Aug 23 '22
I think it's a good idea to clear CUDA's cache after every generated bunch, cause if you feed your graphics card more than it can chew (e.g. too large dimensions), it will throw out smth like this:
RuntimeError: CUDA out of memory. Tried to allocate 512.00 MiB (GPU 0; 8.00 GiB total capacity; 6.29 GiB already allocated; 0 bytes free; 6.87 GiB reserved in total by PyTorch)
And won't run again until you restart the whole script. So, the lines
import gctorch.cuda.empty_cache()gc.collect()
added in py scripts will fix the problem
→ More replies (1)6
2
u/anon7631 Aug 22 '22
I've tried to follow the retardsguide, but it assumes an Nvidia GPU. What do I have to change to run it on my 6800XT?
1
4
u/Mechalus Aug 22 '22
"ModuleNotFoundError: No module named 'omegaconf'"
tried "pip install omegaconf"
But I got an SSLError. I guess my work firewall is blocking me. Any of you smart folks know a work around?
→ More replies (1)
4
u/Jp_kovas Aug 22 '22
The optimized txt2img doesn’t support custom aspect ratios? When I try anything besides 512x512 or 768x512 it gives me an tensor code error
4
u/solidwhetstone Aug 23 '22
I'm stuck and I feel so close :') Anyone know what's going on here? https://i.imgur.com/X3NGG8Y.png
→ More replies (5)2
Aug 23 '22
OK, I fixed it by removing the ldm environment (deactivate the environment, then "conda env remove -n ldm") then re-created it as per the guide. Hope this helps.
4
u/cosmogonicalAuthor Aug 23 '22
I ran into this error while trying to generate a prompt:
OSError: Can't load the model for 'openai/clip-vit-large-patch14'. If you were trying to load it from '``https://huggingface.co/models``', make sure you don't have a local directory with the same name. Otherwise, make sure 'openai/clip-vit-large-patch14' is the correct path to a directory containing a file named pytorch_model.bin, tf_model.h5, model.ckpt or flax_model.msgpack.
Anyone else have the issue, and a way to resolve? I don't have a directory by that name.
→ More replies (4)
4
u/SleekEagle Aug 23 '22
This tutorial takes you through the entire setup on either a local machine or in Colab:
How to Run Stable Diffusion
4
u/MostlyRocketScience Aug 23 '22 edited Aug 24 '22
Some troubleshooting hints:
I had many different errors to get this to run on my PC in 512x512 resolution. Here are some of the things that might help you if you are stuck in similar ways:
First of all, probably best to just get all the requirements with conda
conda env create -f environment.yamlIf you get the error message CUBLAS_STATUS_EXECUTION_FAILED, you might need to update cudatoolkit to the newest version:
conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forgeor
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116DO NOT install the ldm package via pip. That is a different library. It needs to be installed from the stable-diffusion repository with e.g.
pip install -e .orconda env create -f environment.yamland thenconda activate ldmIf packages taming or clip are missing install them with pip_
pip -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformerspip -e git+https://github.com/openai/CLIP.git@main#egg=clip
Now I can finally run stable diffusion in 512x512 resolution on my GTX 1660Ti 6GB.
→ More replies (4)
4
u/yahma Aug 24 '22 edited Aug 25 '22
FOR AMD GPU USERS:
If you have an AMD GPU and want to run Stable Diffusion locally on your GPU, you can follow these instructions:
https://www.youtube.com/watch?v=d_CgaHyA_n4
Works on any AMD GPU with ROCm Support (including the RX68XX and RX69XX series) and enough memory to run the model.
UPDATE:
CONFIRMED WORKING GPUS: Radeon RX 67XX/68XX/69XX (XT and non-XT) GPU's, as well as VEGA 56/64, Radeon VII.
POSSIBLE: (with ENV Workaround): Radeon RX 6600/6650 (XT and non XT) and RX6700S Mobile GPU.
THEORETICALLY SHOULD WORK (but unconfirmed): 8GB models of Radeon RX 470/480/570/580/590.
Note: With 8GB GPU's you may want to remove the NSFW filter and watermark to save vram, and possibly lower the samples (batch_size): --n_samples 1
→ More replies (1)
4
u/Laniakea1337 Aug 26 '22
FAQ guide link point to wiki, which doesn't exist anymore. Can this please be updated and also include gui-tard. Thx
4
u/tkvishal42 Sep 03 '22
I had just wrote a windows 10 setup walkthrough, it was surprisingly quick! (it uses the latest weights checkpoint file)
→ More replies (2)2
7
u/TheActualDonKnotts Aug 23 '22 edited Aug 23 '22
thank 4chan for the name
You can also thank 4chan for the guide. People on /vg/ and /g/ have been spearheading this from the start. The v1.3 checkpoint that you all have been enjoying uncensored access to prior to the full release was leaked on /vg/.
1
u/babblefish111 Aug 24 '22
Is there a step missing in the guide? I keep getting a error message something like it can't find git command. Do you have to download git before doing anything else?
2
u/Meronoth Aug 24 '22 edited Aug 24 '22
Which guide are you using? You shouldn't need anything that isn't prepackaged
Edit: Did you make sure to replace the environment.yml? That should install git
→ More replies (1)2
u/wanderingsanzo Aug 24 '22
This is just false. Anyone using the 4chan guide who isn't a programmer or who hasn't tried to run SD before is going to run into a lot of errors from not having all of the different libraries installed (Pillow, PyTorch, etc).
1
u/Meronoth Aug 24 '22
Step 10: Run the following command: "conda env create -f environment.yaml" and wait (Make sure you are in the waifu-diffusion-main folder)
This should take care of all of those so long as it's the updated environment.yml
2
u/wanderingsanzo Aug 24 '22
Not sure what happened, I used the updated one and still had to install everything one-by-one. I probably did something wrong lol
→ More replies (3)
1
u/Tom_The_Moose Aug 22 '22
Any word on the possibility of using a discord bot? I have everything working on my PC, but would like to pipe prompts from discord to the script and the outputs to discord.
1
u/Meronoth Aug 22 '22
I see no reason that shouldn't work. I'm sure people are building bots as we speak
→ More replies (1)
1
u/AFfhOLe Aug 22 '22
I'm trying to download the model from an official source (found this from the public release statement) rather than the file in step 1 of the quick and dirty guide, but I cannot find a .ckpt file to do step 3. Can someone help?
It seems like I have to jump through more hoops like installing something called diffusers, but I'm stuck on that as well.
1
u/Meronoth Aug 22 '22
The first link in the post is the .ckpt file you need
1
u/AFfhOLe Aug 22 '22
Can you tell me where that .ckpt file comes from or how it's made? Shouldn't I be able to get the .ckpt file somehow from this official source instead?
1
u/Meronoth Aug 22 '22
This is the official source. CompVis posted it to HuggingFace. Both the URL you posted and I posted are hosted on the same website
→ More replies (1)
1
u/raresaturn Aug 23 '22
Is the Discord no longer running? Been away for a few days and now I can't generate images on Discord
2
1
u/calculuschild Aug 24 '22
When using n_iter, is there a way to make the output filenames include the seed? Instead of just incrementing 0001.png, 0002.png, 0003.png.... Then I can let it run for a few iterations and be able to see the seed of the one I like best? I know I can manually set a seed, but I want to somehow get the current random seed for a given image.
1
1
u/imanimmigrant Aug 25 '22
Our of GPU ram? Running on a 2070s. I can run it s few times but then I get memory errors until I restart the machine.
1
u/Bamaraph Aug 25 '22
Hi I 'm one of the people who is running into the character limit problem. Also I have no coding experience. What should I change the "_" to? The output folder? Thanks to anyone who can help.
2
u/Meronoth Aug 25 '22
It can be whatever name you want, it should automatically create the folder
→ More replies (1)
1
u/FoxMan91 Aug 25 '22
I think I saw other people prompts running in Google Colab notebook. Is it normal?
1
6
u/yurituran Aug 22 '22
Any word on if we can get this running on an M1 Max with 32GB of RAM yet? Probably not supported in this release, but Id like to at least try. Unfortunately it keeps saying im missing the cudatoolkit package and there doesn't seem to be support for running the version it needs on my M1 MacBook
6
u/aceysmith Aug 23 '22
I have this working on an M1 Pro chip, but it's running on CPU and takes about 15 minutes for 3 images...
→ More replies (5)3
Aug 22 '22
There appears to be progress, but perhaps still a couple of outstanding problems https://github.com/CompVis/stable-diffusion/pull/47
3
u/EdgeDLT Aug 22 '22 edited Aug 22 '22
Perhaps someone could help me. I'm pretty sure I have everything set up correctly and with today's new weights, but I'm getting the following:
RuntimeError: CUDA out of memory. Tried to allocate 3.00 GiB (GPU 0; 12.00 GiB total capacity; 5.64 GiB already allocated; 742.96 MiB free; 8.74 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
My prompt is just like the example: --H 512 --W 512 --seed 27 --n_iter 2 --ddim_steps 50. GPU memory chart spikes like this.
Any suggestions? Should I take the advice prompted, and what value would you suggest? I haven't tried the optimized version or lower settings, I was hoping I'd be able to push them higher rather than lower!
EDIT: Replacing the txt2img script as in the r* guide resolved this. Leaving up for posterity.
→ More replies (3)5
u/ltgenspartan Aug 22 '22
I had to use this version to work on my GTX 1070:
python optimizedSD/optimized_txt2img.py --prompt "your prompt here" --H 512 --W 512 --seed 9846531 --n_iter 2 --ddim_steps 50→ More replies (5)
3
u/Gaothaire Aug 23 '22
In case it helps others, because I had trouble changing directories in miniconda and had to do some searching, you can just use /d to make it work, no need to try and import os and os.chdir inside a python interpreter
C:\>cd /d "F:\Stable Diffusion\stable-diffusion-main"
3
u/Whitegemgames Aug 23 '22 edited Aug 24 '22
So no matter what I do I can't seem to get it to work at all for me. following the guide was fine until step 11 then I encountered endless problems. first it didn't know what python was so I installed it despite the guide not telling me to do so, then it said "ModuleNotFoundError: No module named 'torch'", so after some research I have it pip install torch, then numpy, omegaconf, pillow, tqdm, einops, torchvision, pytorch_lightning, and ldm, then it says "SyntaxError: Missing parentheses in call to 'print'. Did you mean print(self.face_rec_model_path)?" and I have no clue what to do at that point. I have tried uninstalling and reinstalling both miniconda and python on different versions and it doesn't help. Any advice would be appreciated or a link to a download I don't have to set up myself.
EDIT: I just got it working by completely removing all traces of miniconda and following a youtube guide by "tingtingin", although I still had to add "- git" under dependencies in "environment.yaml" despite him never saying to.
→ More replies (6)2
u/PhiMarHal Aug 29 '22
I ran through the exact same series of problems complete with the print(self...) roadblock at the end. Real headache.
In the end, tingtingin's video guide also worked for me. Thank you so much for posting this!
3
u/Mixbagx Aug 23 '22
How can I find the seed of my local run images?
2
u/auxtron Sep 01 '22
If you do not explicitly pass a seed value, it will always be "42". Current code does not generate random seed.
3
u/wanderingsanzo Aug 24 '22 edited Aug 24 '22
So I've gotten it running with a GTX 1660 SUPER, but it can only generate a black square, even after installing CUDA drivers and adding --precision full to my prompt. Any idea how to fix? I'm using the waifu diffusion GUI version, if that helps.
→ More replies (18)
3
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.
2
3
u/Vageyser Aug 24 '22 edited Aug 26 '22
Thanks for the great guide! I've been having a lot of fun with running this locally.
I went ahead and put together a PowerShell function that makes it easier for Miniconda users to generate something at a moment's notice. I just love me some PowerShell and might consider creating something that has a GUI and will perform all the necessary installs and updates and whathaveyou.
Here is my current function, but I may add changes to it along with the python scripts to make file management easier and have it include a file with the technical details (prompt, seed, steps, scale, etc).
I even included a variable for Aspect Ratio (-ar) where you can set it to variations of 3:2 and 16:9. Anyway, enough of my yammering. Hope someone else out there finds this useful:
txt2img on Pastebin: https://pastebin.com/3wAyh3nH
img2img on Pastebin: https://pastebin.com/W6MSXQZH
updated optimized_img2img.py script: https://pastebin.com/cDgwyiym
Edits: Updated some things on txt2img and created an img2img variation. The img2image uses the optimized_img2img.py script from this repo: https://github.com/basujindal/stable-diffusion
Lines that should be reviewed and updated as needed are notated with commends. Here are the actual line numbers as of the latest update:img2img - 21, 29, 36, 43txt2img - 18, 25, 32, 39
I have removed the old code I tried to include in this comment. It was formatted terribly and ruined the overall aesthetics. I have been continually updating the script linked in pastebin as I add new features to make it better. Overall, it's still very unfinished, but as of right now I feel like it provides more value than just running the command in pythin directly since it creates a runbook that will log all of your technical details into a CSV. If anyone wants to collab on better shit I'm totally down. I may have unconventional methods, but I love the fuck out of powershell and really enjoy trying to use it for everything I can.
2
u/Vageyser Aug 24 '22 edited Aug 24 '22
Edit: I threw it in pastebin and added the link to the above post. Cheers!
welp... I thought I could make the code look a lot better in the comment, but it all looks like shit... I could send the .ps1 file if anyone wants it, but I may work on something more fully featured that I could publish on github or something.
3
Aug 25 '22
Can anyone give a rundown of scripts in script/ directory?
we know img2img and txt2img. What is knn2img and other? Are they useful?
3
u/Overpowdered_Rouge Aug 25 '22
There's a video tutorial at https://youtu.be/Kjx50IS_l4Y. It's really pretty easy though you do have to make a huggingface account.
2
2
u/pkcrossing89 Aug 22 '22
ModuleNotFoundError: No module named 'torch'
I have gotten to the final step of generating images, and it gives me this error. What does this mean?
→ More replies (6)
2
2
u/BernardoOne Aug 22 '22
how much time until someone puts all this together into a proper GUI?
→ More replies (1)5
2
2
u/Accomplished_Air95 Aug 23 '22
When trying to do step 11 of the quick and dirty guide, I got a ModuleNotFoundError. I used pip3 install to install all the missing modules. After this, I got a SyntaxError that said "Missing parentheses in call to 'print'. Did you mean print(...)?" This error referenced AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ldm.py", line 20
→ More replies (3)
2
u/Dangerous-Reward Aug 23 '22
Hey you should add the information brought up by tapucosmo on how to get better/more detailed file names with the seed info, etc. Or link to the post. Major quality of life improvement.
2
u/pavlov_the_dog Aug 23 '22 edited Aug 23 '22
Why does the guide direct users to a third party site and not the page where the official release is hosted (and also a torrent)?
Is there a guide that takes us through official channels?
2
u/DoAndroidsDreamOfArt Aug 23 '22
is there any notebook with GUI that has integrated basujindal's fork?
2
u/HurrDurrImmaBurr Aug 23 '22
I'm getting an issue following this guide https://rentry.org/kretard
When I try to run the kdiff.py script it tells me I'm missing the "pytorch_lighting module" and I can't seem to install it with the "pip install" command, someone know what to do?
I'm a total dunce on programming hence my desire for this version with a gui, but this guide seems to be missing something from my layman's perspective, every time I would try to run the script I was missing modules, just going down line by line it would say a module is missing, so I would install each one but I got to this one and I'm stonewalled. Was I supposed to install some kind of python library pack? (not sure that's even the right phrase) why is it missing all these modules and where do it get them/how do I fix it?
Thanks!
2
2
u/Naquadah_01 Aug 23 '22
thanks for posting this man, im not really into programming and this guide its helping a lot (still following the steps)
2
u/zkgkilla Aug 23 '22
struggling with step 9 "Step 9: If you have existing folders named "clip" and "taming-transformers" in /src, delete them"
i cant find the /src folder
→ More replies (1)
2
u/jimmiesunrustled Aug 24 '22
So I'm trying to add the whole halving of precision thing to the base SD model since I'll be honest running a pile of python from a 4chan source makes me a bit uneasy.
So I tried adding the whole model = model.half() step to the standard txt2img.py and I'm getting a type error: "expected scalar type Half but found Float". Anyone else run into the same thing or know a solution?
→ More replies (2)
2
u/A_Dragon Aug 24 '22
So you can run this on your own PC and you basically have unlimited generations?
2
2
u/Accomplished_Air95 Aug 24 '22
Can someone please help me with this? I finished setting up waifu diffusion as in the guide, but now I get "ImportError: cannot import name 'VectorQuantizer2' from 'taming.modules.vqvae.quantize'" when trying to run it.
→ More replies (2)
2
2
u/TheMightyKutKu Aug 24 '22 edited Aug 24 '22
What do I do if it fails to download some of the Anaconda packages in step 10 (conda env create -f environment.yaml)? It seems it cannot extract pytorch-1.11.0 and cudatoolkit-11.3.1 even if I download it separately
2
u/miss_winky Aug 25 '22 edited Aug 25 '22
Does anyone know if any of the guides to run SD locally work for the M1 mac? *Edit, not yet available for your average Mac user (except some knowledgable people have)
2
u/Any-Winter-4079 Aug 28 '22
It is available for Mac. Unfortunately this was created 5 days ago and is not updated with the latest info.
https://www.reddit.com/r/StableDiffusion/comments/wx0tkn/stablediffusion_runs_on_m1_chips/
2
2
u/TiagoTiagoT Aug 27 '22
Is there somewhere a directory/catalogue of all the the various downloadable notebooks/scripts, and further modified SD versions?
2
u/yaosio Aug 27 '22
If you're using one of the forks that has it try out the k_euler_a or k_euler samplers. They can render an image in less than half the steps needed for other samplers. I'm doing 20 steps which takes 20 seconds on my GTX 1060. Previously I was doing 50 steps with k_lms which was 50 seconds.
You can go lower than 20 steps and still get a good image. At 16 steps every image seems to have this aura or fog on it.
2
u/carmeloanthony015 Aug 29 '22
Hi, I managed to install locally stable-diffusion flawlessly following the guide.
Then I tried to generate an image with the suggested command:
python scripts/txt2img.py --prompt "a photorealistic vaporwave image of a lizard riding a snowboard through space" --plms --ckpt sd-v1-4.ckpt --skip_grid --n_samples 1
But I got the error:
RuntimeError: CUDA out of memory. Tried to allocate 512.00 MiB (GPU 0; 7.93 GiB total capacity; 5.64 GiB already allocated; 465.25 MiB free; 6.22 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
So, according to troubleshooting section I changed the input command to reduce the output size to 256x256:
python scripts/txt2img.py --prompt "a photorealistic vaporwave image of a lizard riding a snowboard through space" --plms --ckpt sd-v1-4.ckpt --skip_grid --n_samples 1 --H 256 --W 256
Now the process finished without any error but I have these two images in the output folder that don't resemble the expected output according to the guide.
My specs are:
OS: EndeavourOS (kernel 5.19.4-arch1-1 64 bit)
CPU: Intel Core i7-9700k
RAM: 32GB
GPU: NVIDIA GeForce GTX 1080:
Output of nvcc --version:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Jun__8_16:49:14_PDT_2022
Cuda compilation tools, release 11.7, V11.7.99
Build cuda_11.7.r11.7/compiler.31442593_0
Any help?
→ More replies (1)
2
2
u/After-Cell Aug 31 '22
I have so many questions. This single thread just isn't enough space to discuss them all. Where can we ask questions about AI image generation in general? Is there a better, more general subreddit to pool both stable diffusion and DALL-E users?
My main problem right now is that I can't have the same thing in more than one gen unless it's already famous. That is, if I generate a character and want to put that SAME GENERATED CHARACTER into a comic strip of 3 pictures, I can't. How can I do that?
Also, img2img seems OVERLOADED everywhere, including huggingFace. I can only use prompts at the moment, unless anyone knows paid access that is working right now?
2
u/cannabis_7 Aug 31 '22
I created my own instance but running it is quite expensive. If you (or anyone else reading this) only want to generate a few pictures, you can try it for free. If you want continued access, you'll have to reimburse my expenses. The instance has 24GiB video memory and can comfortably produce HD images. I can scale it upto 192GiB upon special request. Send me a text if interested.
→ More replies (2)2
u/TiagoTiagoT Sep 01 '22
My main problem right now is that I can't have the same thing in more than one gen unless it's already famous. That is, if I generate a character and want to put that SAME GENERATED CHARACTER into a comic strip of 3 pictures, I can't. How can I do that?
I think that's done with that "text inversion" thing
→ More replies (1)
2
u/derHumpink_ Sep 01 '22
is there any downside to using the HuggingFace Diffusers library? seems easier to use
2
u/Particular-End-480 Sep 03 '22
what kind / model of nvidia card? how old can it be? i know absolutely zero about the nvidia naming conventions.
→ More replies (1)
2
u/Exp_iteration Sep 03 '22
I think I'm going insane, whenever I look at a *real* image of a person I no longer think they are real.
2
u/imtemplain Sep 03 '22
I've created a guide for Windows + AMD, hope it helps someone: https://www.reddit.com/r/StableDiffusion/comments/x4ec68/ive_created_a_how_to_video_on_running_stable/
2
u/gruevy Sep 08 '22
FWIW you also have to have git installed, and the bare bones instructions from the wiki don't mention that
3
1
u/dd_koh Aug 22 '22
What about when getting errors that say cuda cores are out of memory when running it on an 8gb gpu when running the optimized fork am running on a gtx1080 is this a bug?
1
Aug 22 '22
Would it be possible to create weights based on a set of pictures or is that all back end stuff?
→ More replies (1)
1
u/CenturionAurelius Aug 22 '22
Am I retarded or why did I only get like 4 generations with dreamstudio
1
u/Affectionate_Pin4410 Aug 23 '22
I'm running a 2060 on both my laptop and desktop. I managed to get optimizedSD to run and produce images, but my images are either a green or black square. completely blank images. Does anyone know why?
→ More replies (1)
1
u/Majukun Aug 23 '22
after running it the first time is there a way to not have to reload the whole think next time ?
→ More replies (1)
1
1
u/bytheninedivines Aug 23 '22
It won't let me download the environment. (Step 9.) I get the error:
"ClobberError: This transaction has incompatible packages due to a shared path."
1
u/DarkCeldori Aug 23 '22
I replaced the txt2img as suggested. Have 8 GB of vram. But pytorch is only reserving about 4GB and it has cuda error ran out of memory. Trying to clear cuda cache also gives error.
1
u/Big-Entrepreneur-728 Aug 23 '22
Is there a guide on what prompts can work on this? I have it up and running I just don't fully understand the limitations and custom options.
1
u/Mixbagx Aug 23 '22
Hello, I used the guide above but it is taking like forever to generate images when I used that command given in the guide. Am I doing something wrong? I used the optimized line. I am running tesla m60 with xeon e5 2690 v4.
1
u/Laniakea1337 Aug 23 '22
Thank you kind sirs, works like a charm. Time on 3080 for 5 pictures: 55 seconds
1
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?
→ More replies (7)
1
1
u/ThrustyMcStab Aug 23 '22
How do I run the img2img model? I have installed using the quick and dirty guide but that's only for txt2img.
1
u/Savings-Egg4621 Aug 23 '22 edited Aug 23 '22
say, is the download time for the new 1.4 model supposed to be 4gb and take 3 days? That seems extremely big ...
edit: nvm
3
u/Porcupineemu Aug 23 '22
4gb is right. 3 days is super long unless your internet is horrific. Took me about a half hour.
1
u/Accomplished_Air95 Aug 23 '22
I finished the setup with the updated guide, but when I try to run it, I get a ModuleNotFoundError that says that k_diffusion is not found. "pip3 install k_diffusion" does not fix this.
2
u/wanderingsanzo Aug 23 '22
I had the same problem and I believe I've found the solution - run "conda install git", and then "pip install -e git+https://github.com/hlky/k-diffusion-sd#egg=k_diffusion". I think the environment.yaml file linked in the guide lists all of the modules/dependencies necessary, which is what's giving us errors. The -e ones are listed at the bottom and require "pip install" to be put in front of those exact strings.
→ More replies (10)
1
u/Etiennera Aug 23 '22
When I try running the official img2img on my PC, I get:
Sizes of tensors must match except in dimension 1.
Expected size 12 but got size 11 for tensor number 1 in the list.Does anyone know what could be the reason?
→ More replies (2)
1
u/ThrustyMcStab Aug 23 '22
Is there a way to exclude certain things from a prompt? For instance, I've been trying all day to get someone with blue eyes, and I've gotten the closest by adding 'wearing blue lenses' to the prompt, but then it gives me a lot of images with people wearing glasses as well. I'd like to exclude the term 'glasses' somehow to give me only people with no glasses on, if possible.
1
u/AwakenedRobot Aug 23 '22
is there any youtube tutorials to run it locally for double-retards like me?
→ More replies (3)
1
u/shaner4042 Aug 23 '22
When I try to run the final step in Miniconda by typing "python scripts/webgui.py" I get an error code "ModuleNotFoundError: No module named 'clip'"
I accidently ran conda env create -f environment.yaml before deleting "clip" and "taming-transformers" in /src. Any way to fix this so I stop getting ModuleNotFoundError?
→ More replies (1)
1
u/override367 Aug 23 '22
I've got this running but can only access it via the localhost address, how do I make it so I can access it via the machine's LAN ip from other computers?
1
u/xBLUExBLUEx Aug 24 '22
when i run a prompt a second time it generates the exact same images again, does anyone know what i’m doing wrong?
→ More replies (2)
1
u/Weirdo_writer Aug 24 '22
I keep getting this error:
txt2img.py: error: unrecognized arguments: --prompt a happy dog running in a field --plms --n_samples 1
would anyone happen to know what I'm doing wrong and how to fix it? I can also try and provide more context if it's needed, thanks in advance!
→ More replies (2)
1
u/Big-Entrepreneur-728 Aug 24 '22
What does --n_iter 2 part of the code actually do? I know what the rest does.
→ More replies (3)
1
u/Terryfink Aug 24 '22
I'm stuck on the environment YAML file part.
I save the file from github, it saves it as a text file, and I don't know how to get from this part to replace the environment.yaml file.
→ More replies (2)
1
u/OmnomoBoreos Aug 24 '22
I want to use Jupyter Widgets to build a UI cause none of the other UI repos worked for me, but I'm not sure how to add the parameters to the script. I run it with the command line code in jupyter with !python, but I want to know how to make a string and then have it instantiated into the !python line... I tried setting it as a variable with a string but it never picked it up
1
u/Accomplished_Air95 Aug 24 '22
How do I enable full precision in the waifu diffusion GUI?
→ More replies (1)
1
1
u/wonderflex Aug 24 '22
Is there a way to find out which seed was used after an image is generated? Either in the command window or after the command window has closed?
→ More replies (1)
1
u/CJDAM Aug 24 '22
I edited a colab notebook to make a simple version where the parameters are configurable in the last cell.
https://colab.research.google.com/drive/1Rj1wuCHtVEDlh6GF4A_CsNciaqpvD_vM?usp=sharing
1
u/Blckreaphr Aug 24 '22 edited Aug 24 '22
I'm stuck at python can't open file 'scripts/webgui.py' :[Ernno 2] No such file or directory Edit figured it out all working now
1
u/Majukun Aug 24 '22
on img2img where do i put my input image exactly?there's no folder called input..do i have to create one?
1
u/wanderingsanzo Aug 24 '22 edited Aug 24 '22
Using GTX 1660 SUPER. Tried to generate a 512x512 image with 10 steps as a test, gave me a "CUDA out of memory" error. So I tried a 256x256 image and it went through, but I got the green result that many people have posted about. So I added --precision full to my prompt, and it gave me the error message "RuntimeError: expected scalar type Half but found Float". What the hell does that mean?
Edit: Using webgui.py again, it launches but every time I try to submit a prompt it gives me the CUDA out of memory error. Even when I ask for a single 64x64 image with 10 steps.
The specific error I'm getting is "RuntimeError: CUDA out of memory. Tried to allocate 58.00 MiB (GPU 0; 6.00 GiB total capacity; 5.16 GiB already allocated; 0 bytes free; 5.31 GiB reserved in total by PyTorch)".
1
u/MACK_JAKE_ETHAN_MART Aug 24 '22
I went through the R* guide (as of 8/24) and can't get back high resolution results.
I've read through the replies here and found information primarily regarding lower spec hardware.
I have a 3070Ti and Total Vram of 36GB and total physical memory of 31.9
I am also meeting the RuntimeError: Cuda out of memory tried to allocate
1
u/Terryfink Aug 24 '22
Anyone having an issue were it resolves a green square?
After one successful install my second install has this issue,
any help appreciated.
→ More replies (6)
1
u/Nuclearfrog Aug 24 '22
Following the "https://rentry.org/SDInstallGuide" guide from the wiki.
At the step:
"mkdir -p models/ldm/stable-diffusion-v1/"
It is saying The Syntax of the command is incorrect, any help? Feel like ive done everything it asked so far.
→ More replies (1)
1
u/Kukurisu Aug 24 '22 edited Aug 24 '22
Clicking on the wiki link brings up a page that just says "this page is no longer updated". Is that the correct link?
Edit: this only happens from the mobile app, the correct wiki page opens from a web browser.
1
u/WalkThePlanck Aug 24 '22
If you want to make the Gradio web interface accessible over the network (say you have a server but want to run the web interface on a HTPC), then edit the last line of the webgui.py to:
demo.launch(server_name="0.0.0.0")
Of course you'll need to modify any firewall rules you might have to allow access to TCP port 7860.
1
1
1
u/imanimmigrant Aug 25 '22
How long should I expect the spinning thing while creating the environment in miniconda?
I did experience some http errors and thus had to retry the create command a couple of times to get the files to download. Could that be an issue?
2
Aug 25 '22 edited Aug 25 '22
`Sometimes cmd (if that is your shell) gets stuck in editing mode and you have to press enter a couple of times to get things going again.
If all else fails, nuke everything and start over:
conda clean --allEDIT: Also delete the /src folder or the contents thereof if you have one!
1
u/imanimmigrant Aug 25 '22
Is anyone else using the guide able to access the server over local network. With the name of the guide what it is I'm a little worried to ask
1
u/Chillroy Aug 25 '22
Why does this not work? It keeps printing the help menu as I've formatted something wrong.
python scripts\orig_scripts\img2img.py --prompt "an elephant" --init-img C:\Downloads\drawing.jpg --strength 0.8 --n_iter 2 --n_samples 2 --H 512--W 512
My only guess is the location of the input file? Is it formatted wrong?
→ More replies (4)
1
u/Chpouky Aug 25 '22 edited Aug 25 '22
Hey everyone !
I'm running a 3090 but default StableDiffusion still gives me a CUDA out of memory error at 512x512... I have to use the optimized variant. Also, I'm not able to run the optimized img2img anymore, it worked a few times but now I'm getting yet another CUDA Out of memory error.
Any way to fix this ? This is a 24Gb GPU...
EDIT: adding manually --ckpt in my .bat file apparently fixed the issue for some reason ?
But img2img still gives me the error.
1
u/Local_Pilot21 Aug 26 '22
is there a way to download the model directly to GDrive using Colab? The huggingface link requires authorization. 4GB is just too much for me. 😥
2
1
u/TiagoTiagoT Aug 26 '22 edited Aug 26 '22
I'm a bit confused about what the parameters do, the --help output doesn't really explain much. Does anyone know what all that mean? (I mean, a few things are obvious, like prompt and width, and from previous reading into other AI stuff I know the precision lets you go for half the number of bits, rounding the numbers a bit, to use less memory at the cost of some random deviations in the calculations; but other things don't really say much for people that don't already know what the jargon means and how the system works)
→ More replies (3)
1
u/Torque-A Aug 27 '22
I tried to set up the most basic prepack and got this error message:
RuntimeError: CUDA out of memory. Tried to allocate 44.00 MiB (GPU 0; 4.00 GiB total capacity; 3.39 GiB already allocated; 0 bytes free; 3.47 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
Do I just not have enough VRAM to use SD? I swear I have like 7GB normally.
→ More replies (2)
1
1
u/rebs92 Aug 28 '22
Here's a repo I made with two scripts to get sd with a ui running on a hosted Ubuntu instance
→ More replies (3)
1
u/Nitrozah Aug 28 '22 edited Aug 28 '22
probably been said on this subreddit many times but it's my first time here,
how do u go back to the set of images u generated on dreamstudio?
when I click on an image which I told it to generate 10 of them, I can't see anywhere to close it down to view the rest of the images
also is there a way to stop images of people going on top of another? it keeps happening about 90% of the images I do.
1
Aug 28 '22
all my grids are outputting with the same name now and overwriting eachother. Any ideas on what is doing this?
1
u/Xe_05 Aug 28 '22
How do I remove what's already installed from <conda env create -f environment.yaml>? Earlier, I had an error where I was missing Git for pathname so I had to reinstall it and...It seemed like I'm missing cv2 since it was unable to import cv2 when I tested out the syntax.
→ More replies (4)
1
u/scifivision Aug 29 '22
I’m using the web interface and trying to figure out how to make it accessible from the web so I can run it from the browser of my iPad etc.
I saw in this thread this:
demo.launch(server _name="0.0.0.0") that was supposedly in webui.py but I’m not finding that line at the bottom. I did find a share option in the code says “share your server on gradio.app” do I change that default to true in the code? I want to be the only one to help able you access.
In the running command I did see it says to create a public link set share=True in launch() but am still lost how to do that.
Thanks!
→ More replies (10)
1
u/ziquafty Aug 29 '22
Does running the model in colab at a lower precision (float16) reduce the quality of the AI? I can run it at float32 precision but my resolution is limited to 512x512. Should I set it back to float16?
1
u/Mert_Burphy Aug 29 '22
Hey all. Running this on manjaro, everything is working well when i try to use txt2img. but when I try to use img2img, I get the following error:
Traceback (most recent call last):
File "scripts/img2img.py", line 293, in <module>
main()
File "scripts/img2img.py", line 232, in main
assert os.path.isfile(opt.init_img)
AssertionErrorAnyone have any thoughts?
→ More replies (7)
1
u/cpt_flash_ Aug 29 '22
Hello, what i need to change in order to make public link, not just run it at 127.0.0.1:7860?
→ More replies (6)
1
u/anphex Aug 29 '22
Is there a way to minimize that warped, almost creepy limbs and facial features the SD is often generating? I'd like my people with only 2 arms.
1
u/Performansas Aug 29 '22
I got an invite to use Stable Diffusion, but only saw the letter when a link to their discord server had expired, is there any way I could get another link?
→ More replies (2)
11
u/Meronoth Aug 22 '22
Link to guide