Views
No views yet
1pip install pgmap-align
2# or
3pip install git+https://github.com/sophialanlan/PG-MAP1from diffusers import DiffusionPipeline
2from pgmap import sd15_defaults, FrozenRewardModel
3import torch
4
5pipe = DiffusionPipeline.from_pretrained(
6 "stable-diffusion-v1-5/stable-diffusion-v1-5",
7 custom_pipeline="sophialan/pg-map-sd15",
8 torch_dtype=torch.float16,
9 safety_checker=None,
10).to("cuda")
11
12cfg = sd15_defaults() # paper defaults
13reward = FrozenRewardModel("pickscore", device="cuda")
14
15image = pipe(
16 "a phoenix rising from ashes, vivid orange and red feathers",
17 pg_map_config=cfg,
18 reward_model=reward,
19).images[0]pg_map_config=None falls through to the vanilla StableDiffusionPipeline, so the class is a strict superset of the parent.| Method | PickScore | HPS | Aesthetic | CLIP |
|---|---|---|---|---|
| PG-MAP (default) | 56.8% | 52.8% | 54.0% | 50.6% |
| Tuned-CFG + PG-MAP | 53.6% | 66.0% | 60.2% | 56.0% |
1@misc{sun2026pgmap,
2 title={{PG-MAP}: Joint {MAP} Optimization for Inference-Time Alignment of Diffusion and Flow-Matching Models},
3 author={Sun, Ruolan and Polak, Pawel},
4 year={2026},
5 eprint={2606.22958},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/2606.22958}
9}