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 FrozenRewardModel
3import torch
4
5pipe = DiffusionPipeline.from_pretrained(
6 "stabilityai/stable-diffusion-3.5-medium",
7 custom_pipeline="sophialan/pg-map-sd3",
8 torch_dtype=torch.float16,
9).to("cuda")
10
11reward = FrozenRewardModel("pickscore", device="cuda")
12
13# UG-FM (default): 91.9% PickScore configuration
14image = pipe(
15 "a phoenix rising from ashes, vivid orange and red feathers",
16 reward_model=reward,
17).images[0]pg_map_config with optimize_c=True:1from pgmap import sdxl_defaults
2from dataclasses import replace
3
4cfg = sdxl_defaults() # starting point
5cfg = replace(cfg, optimize_c=True, optimize_z=True)
6image = pipe("a phoenix rising from ashes", pg_map_config=cfg).images[0]| Method | PickScore | HPS | Aesthetic | CLIP |
|---|---|---|---|---|
| Static baseline | 50.0% | 50.0% | 50.0% | 50.0% |
| FlowChef (always-on, K=1) | 82.4% | 68.1% | 49.7% | 53.9% |
| FlowChef (gating-matched) | 75.0% | 62.5% | 46.9% | 52.9% |
| UG-FM (Ours) | 91.9% | 75.7% | 51.7% | 54.2% |
with torch.no_grad(): v = v_theta(...)) discards the Jacobian factor $I - (1-t),\partial_z v_\theta$ which is load-bearing.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}