Product

Friday, 19 May 2023

2 ways to Install and run Stable Diffusion locally on Windows

 This article will cover various ways to install and use Stable Diffusion locally on Windows.

The best thing about Stable Diffusion, the free and open source text to-image AI model is that one can install and run it locally on own computer without being dependent on using another company’s online Application like with OpenAI DALL-E

We will cover ways to install and run GUI-based Stable Diffusion locally on Windows as well as through the command line.

Install Stable Diffusion locally on Windows

Whether you use the command line or GUI for generating images from text via Stable Diffusion, there are a few common steps you need to take.

These steps are essential and without them running successfully, you won’t be able to use Stable Diffusion locally on windows.

These steps require that have a GPU-equipped machine. If you don’t have one, use this method that doesn’t require GPU.

Also, you should be able to find your way around a command line program. Don’t worry, it doesn’t require any prior programming or coding experience.

Get the Stable Diffusion AI Weights

  1. Visit https://huggingface.co/ and create an account
  2. Visit https://huggingface.co/CompVis/stable-diffusion-v-1-4-original, scroll down and select “Authorize”
  3. Download the checkpoint: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/blob/main/sd-v1-4.ckpt
  4. Download Stable Diffusion: https://github.com/basujindal/stable-diffusion/archive/refs/heads/main.zip
  5. Unzip stable-diffusion-main.zip file to your preferred location and go to the stable-diffusion-main/models/ldm folder and make a new folder inside called stable-diffusion-v1
  6. Rename the downloaded sd-v1-4.ckpt to model.ckpt and move the file into the stable-diffusion-v1 folder

Install Python dependencies

  1. Go back to the start of the stable-diffusion-main folder and open environment.yaml using Notepad
  2. Scroll down to dependencies: and add the line – git so it looks like:
    dependencies:
    – git
    – python=3.8.5
    – pip=20.3
  3. Download Miniconda from here: https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
  4. Run Miniconda3-latest-Windows-x86_64.exe and install it
  5. Open Anaconda Prompt (miniconda3)
  6. Type cd path to stable-diffusion-main folder, so if you have it saved in Documents you would type cd Documents/stable-diffusion-main
  7. Run the command conda env create -f environment.yaml (you only need to do this step for the first time, otherwise skip it)
  8. Wait for it to process
  9. Run conda activate ldm

Run Stable Diffusion locally on Windows

Launch Stable Diffusion Web GUI to generate images

Going forward you just need to repeat the steps in this section to start generating AI images using GUI Stable Diffusion locally on windows

  1. Run command python optimizedSD/txt2img_gradio.py
  2. Enter the IP address shown in the command window (it will start with 127.0.0.1) into your address bar in your web browser and there is your GUI to create images!

 

Using the command line version of Stable Diffusion

  1. Now you may create prompts using python scripts/txt2img.py –prompt “insert prompt!
    NOTE: If you are receiving CUDA out-of-memory errors, use python optimizedSD/optimized_txt2img.py instead of scripts/txt2img.py!
  • Your images are saved to stable-diffusion-main/outputs/txt2img-samples/<prompt name> by default, you may change it by using –outdir directory_name to change it

References

No comments:

Post a Comment

Connect broadband

AI:List AI views on when for a naive kin after prolonged life suppression coercive behaviour by family members after demise of father with trauma for kin ocd formed after forced to do rituals, family tribal values honor specific activities, utmost religious activities occult witchcraft enforced to do by elder sibling his wife and mother thrice with great celibacy turned the kundalini activated after deep celibacy penance shouting physical Mental financial Extortion by sibling with toxic behaviours and the wife mother and then mockery suppression asking about who’re your worth backbiting among relatives sector toon negligence of intelligence intuitive behaviour- all religious psychological traps when not work and lead to loss of consciousness of kin trance state recovered by governance with technocrats using AI - kin was asked by mother that he’s to go the male should not be seen in house he’s many absurd thought forcefully in brain mind and outsiders already feel awkward of this kin unresponsive behaviour due to TBI PTSD ocd cvt and tell at workplace social gathering he’s to go and asked for sector toon extortion and mockery in various sense due to un practical behaviour negligence of body building due to neglect ion if essential food nutrition and stubbed suppressed in every sense in religious psychological traps by family members AI humanoid using various neural networks and LLMs for kin and required steps.

  List AI views on when for a naive kin after prolonged life suppression coercive behaviour by family members after demise of father with tr...