• Home
  • About
  • Contact
  • Privacy
  • Terms
  • DCMA
  • Write For Us / Submit
Tech News, Magazine & Review WordPress Theme 2017
  • Tech
    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

    Enhance your omnichannel service strategies with data-driven insights.

    Black Market for Fraudulent Ad Accounts Found on Facebook

    Sen. Mark Warner and Sen. Marco Rubio at a hearing.

    Trump’s TikTok ban might have been right after all

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    6 Android Apps for Budget Management

    Twitter, Facebook, Lyft layoffs spark fears of dotcom crash 2.0

  • Gear
    • All
    • Camera
    • Laptop
    • Smartphone
    Latest Smart Home Gadgets for a Connected Life

    Latest Smart Home Gadgets for a Connected Life

    Eco-Friendly Products for Students

    Eco-Friendly Products for Students

    Essential Photography Equipment and Gadgets

    Mastering Your Shots: Essential Photography Equipment and Gadgets

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Pixel Watch in the test

    Google Pixel Watch in the Test

    Top 5 Websites To Buy Camera Lenses At Reasonable Price

    Top 5 Websites To Buy Camera Lenses At Reasonable Price

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Gaming
    9 Best Alternative Games Like Kahoot

    9 Best Alternative Games Like Kahoot

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Game Streaming Platforms: Evolution & Impact on Industry

    Game Streaming Platforms: Evolution & Impact on Industry

    The Rise of Esports Games

    Esports Games: Exploring the Ecosystem, Growth, and Impact

  • Crypto
    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

    Enhance your omnichannel service strategies with data-driven insights.

    Black Market for Fraudulent Ad Accounts Found on Facebook

    Sen. Mark Warner and Sen. Marco Rubio at a hearing.

    Trump’s TikTok ban might have been right after all

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    6 Android Apps for Budget Management

    Twitter, Facebook, Lyft layoffs spark fears of dotcom crash 2.0

  • Business
    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

    Enhance your omnichannel service strategies with data-driven insights.

    Black Market for Fraudulent Ad Accounts Found on Facebook

    Sen. Mark Warner and Sen. Marco Rubio at a hearing.

    Trump’s TikTok ban might have been right after all

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    6 Android Apps for Budget Management

    Twitter, Facebook, Lyft layoffs spark fears of dotcom crash 2.0

No Result
View All Result
Geeky Insider
  • Tech
    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

    Enhance your omnichannel service strategies with data-driven insights.

    Black Market for Fraudulent Ad Accounts Found on Facebook

    Sen. Mark Warner and Sen. Marco Rubio at a hearing.

    Trump’s TikTok ban might have been right after all

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    6 Android Apps for Budget Management

    Twitter, Facebook, Lyft layoffs spark fears of dotcom crash 2.0

  • Gear
    • All
    • Camera
    • Laptop
    • Smartphone
    Latest Smart Home Gadgets for a Connected Life

    Latest Smart Home Gadgets for a Connected Life

    Eco-Friendly Products for Students

    Eco-Friendly Products for Students

    Essential Photography Equipment and Gadgets

    Mastering Your Shots: Essential Photography Equipment and Gadgets

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Pixel Watch in the test

    Google Pixel Watch in the Test

    Top 5 Websites To Buy Camera Lenses At Reasonable Price

    Top 5 Websites To Buy Camera Lenses At Reasonable Price

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Gaming
    9 Best Alternative Games Like Kahoot

    9 Best Alternative Games Like Kahoot

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Game Streaming Platforms: Evolution & Impact on Industry

    Game Streaming Platforms: Evolution & Impact on Industry

    The Rise of Esports Games

    Esports Games: Exploring the Ecosystem, Growth, and Impact

  • Crypto
    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

    Enhance your omnichannel service strategies with data-driven insights.

    Black Market for Fraudulent Ad Accounts Found on Facebook

    Sen. Mark Warner and Sen. Marco Rubio at a hearing.

    Trump’s TikTok ban might have been right after all

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    6 Android Apps for Budget Management

    Twitter, Facebook, Lyft layoffs spark fears of dotcom crash 2.0

  • Business
    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

    Enhance your omnichannel service strategies with data-driven insights.

    Black Market for Fraudulent Ad Accounts Found on Facebook

    Sen. Mark Warner and Sen. Marco Rubio at a hearing.

    Trump’s TikTok ban might have been right after all

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    14 Gift Ideas for the Home Chef (2022): Vitamix, Cookbooks, and More

    6 Android Apps for Budget Management

    Twitter, Facebook, Lyft layoffs spark fears of dotcom crash 2.0

Submit
Geeky Insider
No Result
View All Result

How to Run Stable Diffusion on Your PC to Generate AI Images

by Staff Writer
October 1, 2022
in How To
Reading Time: 12 mins read
An AI-generated magic gopher, artistic Egyptian vulture, and dramatic moonrise over a desert. Header image.
Share on FacebookShare on Twitter

Artificial Intelligence (AI) art is currently all the rage, but most AI image generators run in the cloud. Stable Diffusion is different — you can run it on your very own PC and generate as many images as you want. Here’s how you can install and use Stable Diffusion on Windows.

Table of Contents

  • What Is Stable Diffusion?
  • What Do You Need to Run Stable Diffusion on Your PC?
  • How to Install and Run Stable Diffusion on Windows
    • Installing Git
    • Installing Miniconda3
    • Download the Stable Diffusion GitHub Repository and the Latest Checkpoint
  • How to Use Stable Diffusion
    • How to Make an Image with Stable Diffusion
    • What Do the Arguments in the Command Mean?
    • READ ALSO
    • How to Turn Off Autoplay on YouTube
    • How to go through your CV in a job interview

What Is Stable Diffusion?

Stable Diffusion is an open-source machine learning model that can generate images from text, modify images based on text, or fill in details on low-resolution or low-detail images. It has been trained on billions of images and can produce results that are comparable to the ones you’d get from DALL-E 2 and MidJourney. It’s developed by Stability AI and was first publicly released on August 22, 2022.

Stable Diffusion doesn’t have a tidy user interface (yet) like some AI image generators, but it has an extremely permissive license, and — best of all — it is completely free to use on your own PC (or Mac.)

Update, 9/16/22: Prefer a graphical interface? Try our guide to running Stable Diffusion with a GUI on your PC.

Don’t be intimidated by the fact that Stable Diffusion currently runs in a command-line interface (CLI). Getting it up and running is pretty straight-forward. If you can double-click an executable and type in a box, you can have it running in a few minutes.

What Do You Need to Run Stable Diffusion on Your PC?

Stable Diffusion won’t run on your phone, or most laptops, but it will run on the average gaming PC in 2022. Here are the requirements:

If you don’t have the hardware, consider using a web-based AI image generator. You can even run a demo of Stable Diffusion on the web.

How to Install and Run Stable Diffusion on Windows

There are two pieces of software you need: Git and Miniconda3.

Note: Git and Miniconda3 are both safe programs produced by reputable organizations. You don’t need to worry about malware with them provided that you download them from the official sources linked in this article. 

Installing Git

Git is a tool that allows developers to manage different versions of the software they’re developing. They can maintain multiple versions of the software they’re working on in a central repository simultaneously and allow other developers to contribute to the project.

RELATED: How to Install Git on Windows

If you’re not a developer, Git provides a convenient way to access and download these projects, and that’s how we’ll use it in this case. Download the Windows x64 installer from the Git website, then run it to install Git.

There are several options you’ll be prompted to select while the installer runs — leave them on their default settings. One option page, “Adjusting Your PATH Environment,” is particularly important. It must be set to “Git From The Command Line And Also From 3rd-Party Software.”

Make sure that "Git From The Command Line And Also From 3rd-Party Software" is selected.

Installing Miniconda3

Stable Diffusion draws on a few different Python libraries. If you don’t know much about Python, don’t worry too about this — suffice it to say, the libraries are just software packages that your computer can use to perform specific functions, like transform an image, or do complex math.

RELATED: What Is Python?

Miniconda3 is basically a convenience tool. It lets you download, install, and manage all of the libraries required for Stable Diffusion to function without very much manual intervention. It’ll also be how we actually use Stable Diffusion.

Head over to the Miniconda3 download page and click “Miniconda3 Windows 64-bit” to get the latest installer.

Double-click the executable once it has downloaded to start the installation. Miniconda3’s installation involves less clicking through pages than Git did, but you need to watch out for this option:

Tick the box that says "All Users."

Make sure that you select “All Users” before clicking next and finishing up the installation.

You’ll be prompted to restart your computer after installing Git and Miniconda3. We didn’t find it to be necessary, but it won’t hurt if you do.

Download the Stable Diffusion GitHub Repository and the Latest Checkpoint

Now that we’ve installed the pre-requisite software, we’re ready to download and install Stable Diffusion.

Download the latest checkpoint first — version 1.4 is nearly 5GB, so it might take a while. You need to create an account to download the checkpoint, but they only require a name and email address. Everything else is optional.

Note: At the time of writing (September 2, 2022), the latest checkpoint is version 1.4. If there is a newer version, download that instead.

Click “sd-v1-4.ckpt” to start the download.

Note: The other file, “sd-v1-4-full-ema.ckpt”, might provide better results, but it is about twice the size. You can use either. 

You then need to download Stable Diffusion from GitHub. Click on the green “Code” button, then click “Download ZIP.” Alternatively, you can use this direct download link.

Now we need to prepare a few folders where we’ll unpack all of Stable Diffusion’s files. Click the Start button and type “miniconda3” into the Start Menu search bar, then click “Open” or hit Enter.

We’re going to create a folder named “stable-diffusion” using the command line. Copy and paste the code block below into the Miniconda3 window, then press Enter.

cd C:/
mkdir stable-diffusion
cd stable-diffusion

Note: Almost any time you paste a block of code into a terminal, like Miniconda3, you need to hit Enter at the end to run the last command.

If everything went well, you’ll see something like this:

Minoconda3 terminal showing commands executing successfully.

Keep the Miniconda3 window open, we’ll need it again in a minute.

Open up the ZIP file, “stable-diffusion-main.zip,” that you downloaded from GitHub in your favourite file archiving program. Alternatively, Windows can also open ZIP files by itself if you don’t have one. Keep the ZIP file open in one window, then open another File Explorer window and navigate to the “C:stable-diffusion” folder we just made.

RELATED: Get Help With File Explorer on Windows 10

Drag and drop the folder in the ZIP file, “stable-diffusion-main,” into the “stable-diffusion” folder.

Drag and drop the contents of the ZIP file into the stable-diffusion folder.

Go back to Miniconda3, then copy and paste the following commands into the window:

cd C:stable-diffusionstable-diffusion-main
conda env create -f environment.yaml
conda activate ldm
mkdir modelsldmstable-diffusion-v1

Wait for the download to finish.

Don’t interrupt this process. Some of the files are larger than a gigabyte, so it could take a bit to download. If you do interrupt the process accidentally, you’ll need to delete the environment folder and run conda env create -f environment.yaml again. If that happens, navigate to “C:Users(Your User Account).condaenvs” and delete the “ldm” folder, then run the previous command.

Note: So, what did we just do? Python lets you sort coding projects into “Environments.” Each environment is separate from other environments, so you can load different Python libraries into different environments without having to worry about conflicting versions. It is invaluable if you’re working on multiple projects on one PC.

The lines we ran created a new environment named “ldm,” downloaded and installed all of the necessary Python libraries for Stable Diffusion to work, activated the ldm environment, then changed the directory to a new folder.

We’re on the last step of the installation. Navigate to “C:stable-diffusionstable-diffusion-mainmodelsldmstable-diffusion-v1” in File Explorer, then copy and paste the checkpoint file (sd-v1-4.ckpt) into the folder.

Copy the model file into the stable-diffuse-v1 folder.

Wait for the file to finish transferring, right-click “sd-v1-4.ckpt” and then click “Rename.” Type “model.ckpt” into the highlighted box, then hit Enter to change the file name.

Note: If you’re running Windows 11, you won’t see “rename” in the right-click context menu. There is an icon that looks like a miniature text field instead.

RELATED: Windows 11’s Tiny Context Menu Buttons Will Confuse People

Rename the model file "model.ckpt"

And that’s it — we’re done. We are ready to actually use Stable Diffusion now.

How to Use Stable Diffusion

The ldm environment we created is essential, and you need to activate it any time you want to use Stable Diffusion. Enter conda activate ldm into the Miniconda3 window and hit “Enter.” The (ldm) on the left-hand side indicates that the ldm environment is active.

Note: You only need to enter that command when you open Miniconda3. The ldm environment will remain active as long as you do not close the window.

Activate the ldm environment.

Then we need to change the directory (thus the commandcd) to “C:stable-diffusionstable-diffusion-main” before we can generate any images. Paste cd C:stable-diffusionstable-diffusion-main into command line.

How to Make an Image with Stable Diffusion

We’re going to call a script, txt2img.py, that allows us to convert text prompts into 512×512 images. Here is an example. Try this out to make sure everything is working correctly:

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

Your console will give you a progress indicator as it produces the pictures.

Stable Diffusion generating images.

That command will produce five cat images, all located at “C:stable-diffusionstable-diffusion-mainoutputstxt2img-samplessamples”.

A cat in the style of Pablo Picasso.

It isn’t perfect, but it distinctly resembles the style of Pablo Picasso, just like we specified in the prompt. Your images should look similar but not necessarily identical.

Any time you want to change what image is generated you just need to change the text contained in the double-quotation marks following –prompt.

Tip: Don’t rewrite the entire line every time. Use the arrow keys to move the text cursor around and just replace the prompt.

python scripts/txt2img.py –prompt “YOUR, DESCRIPTIONS, GO, HERE” –plms –n_iter 5 –n_samples 1

Say we wanted to generate a realistic looking gopher in a magical forest wearing a wizard’s hat. We could try the command:

python scripts/txt2img.py –prompt “a photograph of a gopher wearing a wizard hat in a forest, vivid, photorealistic, magical, fantasy, 8K UHD, photography” –plms –n_iter 5 –n_samples 1

A gopher with a purple wizard hat.

It really is that easy — just describe what you want as specifically as you can. If you want something photorealistic, make sure to include terms relating to a realistic image. If you want something inspired by the style of a specific artist, specify the artist.

Stable Diffusion isn’t limited to portraits and animals either, it can also produce striking landscapes.

A calm lake with mountains around it, and a dramatic sky.

What Do the Arguments in the Command Mean?

Stable Diffusion has an enormous number of settings and arguments that you can provide to customize your results. The few included here are basically necessary to ensure Stable Diffusion will run on an average gaming computer.

  • –plms — Specifies how the images will be sampled. There is a paper about it, if you want to check out the math.
  • –n_iter — specifies the number of iterations you want to generate for each prompt. 5 is a decent number to see what kind of results you’re getting.
  • –n_samples — specifies the number of samples that will be generated. The default is 3, but most computers do not have enough VRAM to support that. Stick with 1 unless you have a specific reason to change it.

Of course, Stable Diffusion has a ton of different arguments that you can implement to tweak your results. Run python scripts/txt2img.py –help to get an exhaustive list of arguments that you can use.

There is a ton of trial and error involved in getting great results, but that is at least half of the fun. Make sure you write down or save arguments and descriptions that return results you like. If you don’t want to do all of the experimenting yourself, there are growing communities on Reddit (and elsewhere) dedicated to exchanging pictures and the prompts that generated them.

READ ALSO

How to protect yourself from phishing

Phishing: The nasty tricks of the cybercriminals – this is how they protect themselves

July 28, 2023
How to Unsend an Email in Outlook

How to Unsend an Email in Outlook

November 16, 2022



Source by www.howtogeek.com

Related Posts

transfer whatsapp from android to iphone
Articles

How to Transfer WhatsApp from Android to iPhone!

September 19, 2023
How to prevent phishing attacks
How To

How to Prevent Phishing Attacks: Safeguarding Your Digital Identity

May 14, 2023
How to Activate Iphone With Sim Card
Apple

How to Activate Iphone With Sim Card

March 3, 2023
How to quickly divide or Split PDF files
Apps And Softwares

How to Quickly Divide or Split PDF Files

February 28, 2023

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

GeekDad Daily Deal: SwingLogic SLX MicroSim Home Golf MicroSimulator

GeekDad Daily Deal: SwingLogic SLX MicroSim Home Golf MicroSimulator

July 9, 2022
Pakistan strips YC-backed Tag of fintech services, orders to pull apps • TechCrunch

Pakistan strips YC-backed Tag of fintech services, orders to pull apps • TechCrunch

October 8, 2022

Trending.

MicroSD card in hand.

How to Move Apps to SD Card on an Amazon Fire Tablet

October 5, 2022
How to Downgrade Google Chrome to an Older Version

How to Downgrade Google Chrome to an Older Version

September 7, 2022
Google's No Internet Dino game running on a laptop computer

How to Hack the Hidden Google Chrome Dinosaur Game

October 23, 2022
Employee Payroll Management Software Simplifying Processes

Employee Payroll Management Software: Simplifying Processes

August 23, 2023
Symbolic Link Header Image. A Windows folder on a blue background.

The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows

July 27, 2022
Geeky Insider

Geeky Insider is Web based independent Tech Magazine covering Topics Related to Technology, Gadgets, Software, Gaming, Crypto, Business And So on. Read More...

Submit a Techy Post | Write For Us

Feel free to contact us for submission queries. via contact form or email us at [email protected].

Categories

  • Android
  • Apple
  • Apps And Softwares
  • Articles
  • Business
  • Camera
  • Crypto
  • Education
  • Entertainment
  • Gadget and Gear
  • Gaming
  • How To
  • Laptop
  • Marketing
  • Microsoft
  • Review
  • Security
  • Smartphone
  • Technology
00-samsung FRP unlock tool

Unlock Samsung in Minutes: 5 Proven Hacks with the Ultimate FRP Unlock Tool!

September 19, 2023
transfer whatsapp from android to iphone

How to Transfer WhatsApp from Android to iPhone!

September 19, 2023
Understanding the Role of Humidity Chambers in Climate Testing

Understanding the Role of Humidity Chambers in Climate Testing

September 4, 2023
  • Home
  • About
  • Contact
  • Privacy
  • Terms
  • DCMA
  • Write For Us / Submit

© 2022 GeekyInsider.com

No Result
View All Result
  • Home
  • Review
  • Apple
  • Gaming
  • Gadget and Gear
    • Camera
    • Smartphone
  • Microsoft
  • Security