Visual Generation Models
Collection
9 items • Updated • 1
How to use BiliSakura/Self-Flow-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("BiliSakura/Self-Flow-diffusers", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("BiliSakura/Self-Flow-diffusers", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]Diffusers-ready checkpoints for Self-Flow (Self-Supervised Flow Matching), converted from the official Self-Flow release for local/offline use.
This root folder is a model collection that contains:
Self-Flow-XL-2-256Each subfolder is a self-contained Diffusers model repo with:
pipeline.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)Each variant embeds English id2label in model_index.json, so class labels can be passed as ImageNet ids or English synonym strings.
Class-conditional sample (ImageNet class 207, golden retriever), Self-Flow-XL/2 at 256×256, 250 steps, CFG 3.5, seed 42.
Use paths relative to this root README:
| 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 |
from pathlib import Path
import torch
from diffusers import DiffusionPipeline
model_dir = Path("./Self-Flow-XL-2-256").resolve()
device = "cuda" if torch.cuda.is_available() else "cpu"
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.bfloat16,
)
pipe.to(device)
generator = torch.Generator(device=device).manual_seed(42)
print(pipe.id2label[207])
print(pipe.get_label_ids("golden retriever")) # [207]
image = pipe(
class_labels="golden retriever",
num_inference_steps=250,
guidance_scale=3.5,
generator=generator,
).images[0]
image.save("self_flow_xl_256_demo.png")