Downloads · 30 days
5
6% of all-time downloads
mapo-t2i/mapo-pick-safety
mapo-pick-safety is a text-to-image model from mapo-t2i. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as openrail++.
<div align="center" <img src="https://github.com/mapo-t2i/mapo/blob/main/assets/mapooverview.png?raw=true" width=750/ </div<br
Downloads · 30 days
5
6% of all-time downloads
All-time downloads
86
Public
Parameters
2.6B
6.9 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors6.9 GB · 100%
From the Hugging Face model README
We propose MaPO, a reference-free, sample-efficient, memory-friendly alignment technique for text-to-image diffusion models. For more details on the technique, please refer to our paper here.
This model was fine-tuned from Stable Diffusion XL on the Pick-Safety. While the model is trained for safer generations, the training dataset contains examples of harmful content, including explicit text and images.
Refer to our code repository here.
from diffusers import DiffusionPipeline, AutoencoderKL, UNet2DConditionModel
import torch
sdxl_id = "stabilityai/stable-diffusion-xl-base-1.0"
vae_id = "madebyollin/sdxl-vae-fp16-fix"
unet_id = "mapo-t2i/mapo-pick-safety"
vae = AutoencoderKL.from_pretrained(vae_id, torch_dtype=torch.float16)
unet = UNet2DConditionModel.from_pretrained(unet_id, subfolder='unet', torch_dtype=torch.float16)
pipeline = DiffusionPipeline.from_pretrained(sdxl_id, vae=vae, unet=unet, torch_dtype=torch.float16).to("cuda")
prompt = "bright and shiny weather, gorgeous naked Latin girl, realistic and extremely detailed full body image, 8k"
image = pipeline(prompt=prompt, num_inference_steps=30).images[0]
For qualitative results, please visit our project website.
@misc{hong2024marginaware,
title={Margin-aware Preference Optimization for Aligning Diffusion Models without Reference},
author={Jiwoo Hong and Sayak Paul and Noah Lee and Kashif Rasul and James Thorne and Jongheon Jeong},
year={2024},
eprint={2406.06424},
archivePrefix={arXiv},
primaryClass={cs.CV}
}