Skip to content

gymdreams8/sdlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sdlab

Stable Diffusion Lab using Python

Installation

Developed on Apple Silicon, with pytorch nightly. See GymDreams8 Docs Pytorch Nightly for details.

# Create virtualenv with pyenv
pyenv virtualenv 3.10.9 sdlab

# Activate virtualenv
pyenv shell sdlab

# Install Pytorch Nightly
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu

# Install requirements
pip install -r requirements.txt

Usage

txt2img

Just run the script ./sdlab/txt2img.py e.g.:

python ./sdlab/txt2img.py

Notes

CUDA

I dev on an M2Max so the pipeline is intentionally not run on a GPU. I’ll add a config to run on CUDA later, but since this was just for me, having CUDA in this code is not a priority. I believe that all you need to add is:

pipe.to("cuda")

Folders

Also for my own dev only, but I save my images to Dropbox. You can replace these with your own paths and safe tensors models.

txt2img = Text2Image(
    model_path='~/_StableDiffusion_Models/Stable-diffusion/airfucksBruteMix_v10.safetensors',
    outputs_path='~/Dropbox/StableDiffusion/outputs_code',
    prompt='man'
)

About

Stable Diffusion Lab using Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages