|
--- |
|
license: openrail++ |
|
tags: |
|
- text-to-image |
|
- stable-diffusion |
|
library_name: diffusers |
|
inference: false |
|
--- |
|
|
|
# SDXS-512-DreamShaper-Anime |
|
|
|
SDXS is a model that can generate high-resolution images in real-time based on prompt texts, trained using score distillation and feature matching. |
|
For more information, please refer to our research paper: [SDXS: Real-Time One-Step Latent Diffusion Models with Image Conditions](https://arxiv.org/abs/2403.16627). |
|
We open-source the model as part of the research. |
|
|
|
SDXS-512-DreamShaper-Anime is the anime-style **LoRA** for [SDXS-512-DreamShaper](https://huggingface.co/IDKiro/sdxs-512-dreamshaper). |
|
Watch [our repo](https://github.com/IDKiro/sdxs) for any updates. |
|
|
|
|
|
## Diffusers Usage |
|
|
|
![](output.png) |
|
|
|
```python |
|
import torch |
|
from diffusers import StableDiffusionPipeline |
|
import peft |
|
|
|
repo = "IDKiro/sdxs-512-dreamshaper" |
|
lora_repo = "IDKiro/sdxs-512-dreamshaper-anime" |
|
seed = 42 |
|
weight_type = torch.float16 # or float32 |
|
|
|
# Load model. |
|
pipe = StableDiffusionPipeline.from_pretrained(repo, torch_dtype=weight_type) |
|
pipe.unet = PeftModel.from_pretrained(pipe.unet, lora_repo) |
|
pipe.to("cuda") |
|
|
|
prompt = "a close-up picture of an old man standing in the rain" |
|
|
|
# Ensure using 1 inference step and CFG set to 0. |
|
image = pipe( |
|
prompt, |
|
num_inference_steps=1, |
|
guidance_scale=0, |
|
generator=torch.Generator(device="cuda").manual_seed(seed) |
|
).images[0] |
|
|
|
image.save("output.png") |
|
``` |
|
|
|
## Cite Our Work |
|
|
|
``` |
|
@article{song2024sdxs, |
|
author = {Yuda Song, Zehao Sun, Xuanwu Yin}, |
|
title = {SDXS: Real-Time One-Step Latent Diffusion Models with Image Conditions}, |
|
journal = {arxiv}, |
|
year = {2024}, |
|
} |
|
``` |
|
|