Views
No views yet
Self-Flow-XL-2-256pipeline.py (SelfFlowPipeline)transformer/transformer_selfflow.py and weightsscheduler/scheduling_flow_match_selfflow.py (SelfFlowFlowMatchScheduler, SDE flow matching)scheduler/scheduler_config.jsonvae/ (stabilityai/sd-vae-ft-ema)id2label in model_index.json, so class labels can be passed as ImageNet ids or English synonym strings.
Self-Flow-XL/2 at 256×256, 250 steps, CFG 3.5, seed 42.| Model | Resolution | Local path |
|---|---|---|
| Self-Flow-XL/2 | 256×256 | ./Self-Flow-XL-2-256 |
| Setting | Value |
|---|---|
| Resolution | 256×256 |
| Sampler | Self-Flow SDE flow matching |
| Steps | 250 |
| CFG scale | 3.5 |
| Guidance interval | (0.0, 0.7) when CFG > 1 |
| Dtype | bfloat16 (recommended on Ampere+) |
| VAE | stabilityai/sd-vae-ft-ema |
1from pathlib import Path
2import torch
3from diffusers import DiffusionPipeline
4
5model_dir = Path("./Self-Flow-XL-2-256").resolve()
6device = "cuda" if torch.cuda.is_available() else "cpu"
7
8pipe = DiffusionPipeline.from_pretrained(
9 str(model_dir),
10 local_files_only=True,
11 custom_pipeline=str(model_dir / "pipeline.py"),
12 trust_remote_code=True,
13 torch_dtype=torch.bfloat16,
14)
15pipe.to(device)
16
17generator = torch.Generator(device=device).manual_seed(42)
18
19print(pipe.id2label[207])
20print(pipe.get_label_ids("golden retriever")) # [207]
21
22image = pipe(
23 class_labels="golden retriever",
24 num_inference_steps=250,
25 guidance_scale=3.5,
26 generator=generator,
27).images[0]
28image.save("self_flow_xl_256_demo.png")