Skip to content

Latest commit

 

History

History
128 lines (85 loc) · 5.24 KB

How-To-Use-Stable-Diffusion-SDXL-Locally-And-Also-In-Google-Colab.md

File metadata and controls

128 lines (85 loc) · 5.24 KB

image Hits

Patreon BuyMeACoffee Furkan Gözükara Medium Codio Furkan Gözükara Medium

YouTube Channel Furkan Gözükara LinkedIn Udemy Twitter Follow Furkan Gözükara

[Tutorial] How To Use Stable Diffusion SDXL Locally And Also In Google Colab

On Google Colab

Click to open Colab link

Click to see where Colab generated images will be saved

Now you can set any count of images and Colab will generate as many as you set

On Windows - WIP

Prerequisites

Full tutorial for python and git installation with venv

Download and install Python 3.10.x (3.10.6, 3.10.9, 3.10.11) and git

Automatic Installation

  • This installation won't affect or your break your other installations such as Automatic1111 Web UI
  • Auto Installer Script : https://www.patreon.com/posts/85678961
  • Instructions of auto installer shared in the post

Manual Installation

  • This installation won't affect or your break your other installations such as Automatic1111 Web UI
git clone https://github.com/FurkanGozukara/stable-diffusion-xl-demo
python -m venv venv
cd venv
cd scripts
activate
cd..
cd..
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install -U --pre xformers
pip install -r requirements2.txt

After Installation Run As Below

  • First edit app2.py and add your access_token. E.g. like below

  • access_token = "hf_ovfazhEBOXmTpUsfdfdshfdydZIfMNJVKrcZ"

  • The access token is only 1 time

  • After that you have to save below commands depending on your VRAM as .bat file and use them to start

  • Watch tutorial video again if you can't make it. All steps are shown

Low VRAM (12 GB and Below)

@echo off

set VENV_PATH=stable-diffusion-xl-demo\venv\Scripts\activate.bat

call "%VENV_PATH%"

set PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128
set ENABLE_REFINER=false

python stable-diffusion-xl-demo\app2.py

pause

High VRAM (24 GB and above)

@echo off

set VENV_PATH=stable-diffusion-xl-demo\venv\Scripts\activate.bat

call "%VENV_PATH%"

set PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:256
set ENABLE_REFINER=true

python stable-diffusion-xl-demo\app2.py

pause