Error Running Stable Diffusion from the command line in Windows

inkblot

I installed Stable Diffusion v1.4 by following the instructions described in https://www.howtogeek.com/830179/how-to-run-stable-diffusion-on-your-pc-to-generate-ai-images/#autotoc_anchor_2

My machine heavily exceeds the min reqs to run Stable Diffusion: Windows 11 Pro 11th Gen Intel i7 @ 2.30GHz Latest NVIDIA GeForce GPU 16GB Memory 1TB SSD

Yet, I get an error when trying to run the test prompt python scripts/txt2img.py --prompt "a close-up portrait of a cat by pablo picasso, vivid, abstract art, colorful, vibrant" --plms --n_iter 5 --n_samples 1

RuntimeError: CUDA out of memory. Tried to allocate 1024.00 MiB (GPU 0; 8.00 GiB total capacity; 6.13 GiB already allocated; 0 bytes free; 6.73 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

Reading a post by Marco Ramos it seems like it relates to the number of workers in PyTorch Strange Cuda out of Memory behavior in Pytorch

How do I change the number of workers while running Stable Diffusion? And why is it throwing this error if my machine still has lots of memory? Has anyone encountered this same issue while running Stable Diffusion?

OortCloud21

I had the same issue, it's because you're using a non-optimized version of Stable-Diffusion. You have to download basujindal's branch of it, which allows it use much less ram by sacrificing the precision, this is the branch - https://github.com/basujindal/stable-diffusion Everything else in that guide stays the same just clone from this version. It allow you to even push past 512x512 default resolution, you can use 756x512 to get rectangular images for example (but the results may vary since it was trained on a 512 square set).

the new prompt becomes python optimizedSD/optimized_txt2img.py --prompt "blue orange" --H 756 --W 512

Also another note: as of a few days ago an even faster and more optimized version was released by neonsecret (https://github.com/basujindal/stable-diffusion), however I'm having issues installing it, so can't really recommend it but you can try it as well and see if it works for you.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Running tsc from the Windows command line

command not found error on Mac when running mfp from command line

Error in Running abaqus cae command from command line interface

font config error launching google-chrome-stable from the command line on 14.04.5

Python 3 installation on windows running from command line

Running Jenkins from command line vs as Windows service

Running Universal Windows unit tests from the command line

Running java programs from the command line on Windows 10

error when running az appconfig from command line

Running Matlab function from linux command line -- syntax error?

Error running Xcode Unit Tests from Command Line

automatically download latest stable tarball from sourceforge from command line?

Running PackageMaker from command line

Running this from command line in Java

Running Scheme from the command line

Running Python from Command Line

running pug from command line

Stable Diffusion can't connect to the server running inside docker

installing and running Stable Diffusion on 64-bit Ubuntu 22.04 LTS

Running Windows 7 Virtualbox on Ubuntu command Line

Running jupyter via command line on Windows

Running Python scripts through the Windows Command Line

Error in running trace32 with command line

Running `mongo` in the command line is giving error

ipython from windows command line

Executing a python script from scala giving error while running the same script from the command line does NOT

multipledispatch ModuleNotFoundError running from command-line

Running FxCop analyzers from command line

find where a program is running from command line