|
--- |
|
tags: |
|
- stable-diffusion |
|
- stable-diffusion-diffusers |
|
- text-to-image |
|
- DDPO |
|
inference: true |
|
--- |
|
|
|
# Aligned Diffusion Model via DDPO |
|
|
|
Diffusion Model aligned with the following reward models and Denoising Diffusion Policy Optimization (DDPO) algorithm |
|
``` |
|
close-sourced vlm: claude3-opus gpt-4o gpt-4v |
|
``` |
|
|
|
## How to Use |
|
|
|
You can load the model and perform inference as follows: |
|
```python |
|
from diffusers import StableDiffusionPipeline, UNet2DConditionModel |
|
|
|
pretrained_model_name = "runwayml/stable-diffusion-v1-5" |
|
pipeline = StableDiffusionPipeline.from_pretrained(pretrained_model_name, torch_dtype=torch.float16) |
|
|
|
lora_path = os.path.join(""path/to/checkpoint"") |
|
pipeline.sd_pipeline.load_lora_weights(lora_path) |
|
pipeline.sd_pipeline.to("cuda") |
|
|
|
generator = torch.Generator(device='cuda') |
|
generator = generator.manual_seed(1) |
|
|
|
prompt = "a pink flower" |
|
|
|
image = pipeline(prompt=prompt, generator=generator, guidance_scale=5).images[0] |
|
``` |
|
|
|
## Citation |
|
``` |
|
@misc{mjbench2024mjbench, |
|
title={MJ-BENCH: Is Your Multimodal Reward Model Really a Good Judge?}, |
|
author={Chen*, Zhaorun and Du*, Yichao and Wen*, Zichen and Zhou*, Yiyang and Cui, Chenhang and Weng, Zhenzhen and Tu, Haoqin and Wang, Chaoqi and Tong, Zhengwei and HUANG, Leria and Chen, Canyu and Ye, Qinghao and Zhu, Zhihong and Zhang, Yuqing and Zhou, Jiawei and Zhao, Zhuokai and Rafailov, Rafael and Finn, Chelsea and Yao, Huaxiu}, |
|
year={2024} |
|
} |
|
``` |