Home

Awesome

SimpleSDM-3

This repository contains a simple and flexible PyTorch implementation of StableDiffusion-3 based on diffusers. The main purpose is to make it easier for generative model researchers to do DIY design and fine-tuning based on the powerful SDM-3 model.

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

Limitations

Prepartion

from huggingface_hub import hf_hub_download
hf_hub_download(repo_id="stabilityai/stable-diffusion-3-medium-diffusers", local_dir="./ckpt")
export HF_ENDPOINT=https://hf-mirror.com
huggingface-cli download --resume-download stabilityai/stable-diffusion-3-medium-diffusers --local-dir ckpt --local-dir-use-symlinks False

Requirements

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

conda env create -f environment.yaml
conda activate sdm3

Dataset Preparation

Training

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 checkpoint from SDM-3 and code bases from diffusers and SimpleSDM.