Text-to-Image
Diffusers
Safetensors
StableDiffusionXLPipeline
stable-diffusion-xl
stable-diffusion
inversion
dpo
fine-tuned
Instructions to use ashllay/Inversion-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ashllay/Inversion-DPO with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ashllay/Inversion-DPO", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
| base_model: stabilityai/stable-diffusion-xl-base-1.0 | |
| library_name: diffusers | |
| license: apache-2.0 | |
| pipeline_tag: text-to-image | |
| tags: | |
| - stable-diffusion-xl | |
| - stable-diffusion | |
| - diffusers | |
| - inversion | |
| - dpo | |
| - fine-tuned | |
| # Inversion-DPO | |
| **Original** https://huggingface.co/ezlee258258/Inversion-DPO | |
| I have only added vae, text enconders from Stability AI, consolidated the unet and converted to a single .safetensor file FP32 and BF16. | |
| **StabilityAI SDXL1.0** https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0 | |
| **Paper**: [Inversion-DPO: Precise and Efficient Post-Training for Diffusion Models](https://huggingface.co/papers/2507.11554) | |
| **Code Repository**: https://github.com/MIGHTYEZ/Inversion-DPO | |
| ## Model Description | |
| This repository contains the fine-tuned UNet weights from the Inversion-DPO method, built upon Stable Diffusion XL. The model has been trained using Direct Preference Optimization (DPO) techniques combined with inversion methods to improve generation quality and alignment. | |
| ## Quick Start | |
| ```python | |
| from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel | |
| import torch | |
| # Load the fine-tuned UNet | |
| unet = UNet2DConditionModel.from_pretrained( | |
| "ezlee258258/Inversion-DPO", | |
| subfolder="unet" | |
| ) | |
| # Load the pipeline with the fine-tuned UNet | |
| pipe = StableDiffusionXLPipeline.from_pretrained( | |
| "stabilityai/stable-diffusion-xl-base-1.0", | |
| unet=unet | |
| ) | |
| pipe = pipe.to("cuda") | |
| # Generate images | |
| prompt = "A beautiful landscape with mountains and lakes" | |
| image = pipe(prompt).images[0] | |
| image.save("output.png") | |
| ``` | |
| ## Citation | |
| If you use this model in your research, please cite our work: | |
| ```bibtex | |
| @misc{li2025inversiondpo, | |
| title={Inversion-DPO: Precise and Efficient Post-Training for Diffusion Models}, | |
| author={Zejian Li and Yize Li and Chenye Meng and Zhongni Liu and Yang Ling and Shengyuan Zhang and Guang Yang and Changyuan Yang and Zhiyuan Yang and Lingyun Sun}, | |
| year={2025}, | |
| eprint={2507.11554}, | |
| archivePrefix={arXiv}, | |
| primaryClass={cs.CV} | |
| } | |
| ``` | |
| ## Acknowledgments | |
| Built upon [Stable Diffusion XL](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) by Stability AI. | |
| ## Contact | |
| For questions and support, please visit our [GitHub repository](https://github.com/MIGHTYEZ/Inversion-DPO). |