pMF-diffusers / README.md
BiliSakura's picture
Update README.md
154d350 verified
|
Raw
History Blame Contribute Delete
1.86 kB
---
license: mit
library_name: diffusers
pipeline_tag: text-to-image
tags:
- diffusers
- pmf
- image-generation
- class-conditional
- imagenet
inference: true
widget:
- output:
url: pMF-H-32/demo.png
---
# pMF-diffusers
Native diffusers implementation of [Pixel Mean Flows (pMF)](https://arxiv.org/abs/2601.22158). Each variant folder is self-contained:
- `pipeline.py` — `PMFPipeline`
- `scheduler/scheduler_config.json` — `FlowMatchEulerDiscreteScheduler` config
- `transformer/transformer_pmf.py` — `PMFTransformer2DModel`
- `transformer/` — converted weights and config
## Available checkpoints
| Checkpoint | Path | Resolution | Recommended CFG (ω) | CFG interval | Noise scale |
| --- | --- | --- | --- | --- | --- |
| pMF-B/16 | `./pMF-B-16` | 256×256 | 7.5 | [0.1, 0.8] | 1.0 |
| pMF-B/32 | `./pMF-B-32` | 512×512 | 6.5 | [0.1, 0.7] | 2.0 |
| pMF-L/16 | `./pMF-L-16` | 256×256 | 7.0 | [0.2, 0.7] | 1.0 |
| pMF-L/32 | `./pMF-L-32` | 512×512 | 7.5 | [0.2, 0.6] | 4.0 |
| pMF-H/16 | `./pMF-H-16` | 256×256 | 7.0 | [0.2, 0.6] | 2.0 |
| pMF-H/32 | `./pMF-H-32` | 512×512 | 5.5 | [0.1, 0.6] | 4.0 |
## Inference
```python
from pathlib import Path
from diffusers import DiffusionPipeline
import torch
model_dir = Path("./pMF-L-16")
pipe = DiffusionPipeline.from_pretrained(
str(model_dir),
local_files_only=True,
custom_pipeline=str(model_dir / "pipeline.py"),
trust_remote_code=True,
torch_dtype=torch.float32,
).to("cuda")
generator = torch.Generator(device="cuda").manual_seed(42)
image = pipe(
class_labels="golden retriever",
num_inference_steps=1,
guidance_scale=7.0,
guidance_interval_min=0.2,
guidance_interval_max=0.7,
noise_scale=1.0,
generator=generator,
).images[0]
image.save("demo.png")
```
Load a **variant subfolder** (e.g. `./pMF-L-16`), not the repo root.