Downloads · 30 days
0
SPO-Diffusion-Models/SPO-SDXL_4k-p_10ep_LoRA
SPO-SDXL_4k-p_10ep_LoRA is a text-to-image model from SPO-Diffusion-Models. Use it when you need an image from a text prompt. The card lists the license as apache-2.0.
<a href="https://arxiv.org/abs/2406.04314"<img src="https://img.shields.io/badge/Paper-arXiv-red?style=for-the-badge" height=22.5</a <a href="https://github.com/RockeyCoss/SPO"<img src="https://img.shields.io/badge/Gi…
Downloads · 30 days
0
Access
Public
Updated Dec 17, 2024
Repo size
378 MB
Likes
31
Public
Click a slice to open those files.
.safetensors372 MB · 98%
From the Hugging Face model README
<a href="https://arxiv.org/abs/2406.04314"><img src="https://img.shields.io/badge/Paper-arXiv-red?style=for-the-badge" height=22.5></a> <a href="https://github.com/RockeyCoss/SPO"><img src="https://img.shields.io/badge/Gihub-Code-succees?style=for-the-badge&logo=GitHub" height=22.5></a> <a href="https://rockeycoss.github.io/spo.github.io/"><img src="https://img.shields.io/badge/Project-Page-blue?style=for-the-badge" height=22.5></a>
<table> <tr> <td><img src="assets/imgs/0.png" alt="teaser example 0" width="200"/></td> <td><img src="assets/imgs/1.png" alt="teaser example 1" width="200"/></td> <td><img src="assets/imgs/2.png" alt="teaser example 2" width="200"/></td> <td><img src="assets/imgs/3.png" alt="teaser example 3" width="200"/></td> </tr> </table>This model is fine-tuned from stable-diffusion-xl-base-1.0. It has been trained on 4,000 prompts for 10 epochs. This checkpoint is a LoRA checkpoint. We also provide a LoRA checkpoint compatible with stable-diffusion-webui, which can be accessed here
If you want to access the merged checkpoint that combines the LoRA checkpoint with the base model stable-diffusion-xl-base-1.0, please visit SPO-SDXL_4k-p_10ep.
from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel
import torch
# load pipeline
inference_dtype = torch.float16
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=inference_dtype,
)
vae = AutoencoderKL.from_pretrained(
'madebyollin/sdxl-vae-fp16-fix',
torch_dtype=inference_dtype,
)
pipe.vae = vae
pipe.load_lora_weights("SPO-Diffusion-Models/SPO-SDXL_4k-p_10ep_LoRA")
pipe.to('cuda')
generator=torch.Generator(device='cuda').manual_seed(42)
image = pipe(
prompt='a child and a penguin sitting in front of the moon',
guidance_scale=5.0,
generator=generator,
output_type='pil',
).images[0]
image.save('moon.png')
If you find our work or codebase useful, please consider giving us a star and citing our work.
@article{liang2024step,
title={Aesthetic Post-Training Diffusion Models from Generic Preferences with Step-by-step Preference Optimization},
author={Liang, Zhanhao and Yuan, Yuhui and Gu, Shuyang and Chen, Bohan and Hang, Tiankai and Cheng, Mingxi and Li, Ji and Zheng, Liang},
journal={arXiv preprint arXiv:2406.04314},
year={2024}
}