Home

Awesome

SimpleSDXL

This repository contains a simple and flexible PyTorch implementation of StableDiffusion-XL based on diffusers.

<div align="center"> <img src="architecture.png"> </div>

Prepartion

yum install git-lfs
git lfs install
git clone https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0
git clone https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0

Requirements

A suitable conda environment named ldm can be created and activated with:

conda env create -f environment.yaml
conda activate ldm

Dataset Preparation

Training

CUDA_VISIBLE_DEVICES=0 python train.py
CUDA_VISIBLE_DEVICES=0,1,2 accelerate launch --multi_gpu train.py

Inference

CUDA_VISIBLE_DEVICES=0 python inference.py --prompt "A cat is running in the rain."

TODO

Acknowledgements

Many thanks to the code bases from diffusers and SimpleSDM.