BiliSakura/PixelFlow-diffusers

Self-contained PixelFlow checkpoints for Hugging Face diffusers. Each subfolder ships its own pipeline.py, component modules, and weights.

Available checkpoints

Subfolder Task Resolution Params
PixelFlow-256/ class-to-image 256Γ—256 677M
PixelFlow-T2I/ text-to-image 1024Γ—1024 882M

ImageNet class labels

For class-conditional PixelFlow-256/, ImageNet-1k labels live in shared labels/ at the repo root:

File Direction Value format
labels/id2label_en.json id β†’ English comma-separated synonyms, e.g. "207": "golden retriever"
labels/id2label_cn.json id β†’ Chinese comma-separated synonyms, e.g. "207": "ι‡‘ζ―›ηŒŽηŠ¬"

After PixelFlowPipeline.from_pretrained(...), the pipeline exposes:

  • pipe.id2label / pipe.id2label_cn β€” inspect id β†’ label correspondence
  • pipe.labels / pipe.labels_cn β€” reverse maps (synonym β†’ id)
  • pipe.get_label_ids("golden retriever") or pipe.get_label_ids("ι‡‘ζ―›ηŒŽηŠ¬", lang="cn")
  • pipe(class_labels="golden retriever", ...) β€” string labels resolved automatically

Demo

PixelFlow-256 demo

Load from a local clone

import sys
from pathlib import Path

repo = Path("BiliSakura/PixelFlow-diffusers").resolve()
variant = "PixelFlow-256"

sys.path.insert(0, str(repo / variant))
from pipeline import PixelFlowPipeline

pipe = PixelFlowPipeline.from_pretrained(".")
pipe.to("cuda")

images = pipe(
    class_labels=207,
    num_inference_steps=[10, 10, 10, 10],
    guidance_scale=4.0,
).images

# Human-readable ImageNet labels (English or Chinese)
print(pipe.id2label[207])          # "golden retriever"
print(pipe.id2label_cn[207])       # "ι‡‘ζ―›ηŒŽηŠ¬"
pipe.get_label_ids("golden retriever")  # [207]
pipe.get_label_ids("ι‡‘ζ―›ηŒŽηŠ¬", lang="cn")  # [207]
images = pipe(class_labels="golden retriever", num_inference_steps=[10, 10, 10, 10]).images

Text-to-image (PixelFlow-T2I)

Uses google/flan-t5-xl as the text encoder (loaded from Hugging Face at runtime, not bundled in the repo).

variant = "PixelFlow-T2I"
sys.path.insert(0, str(repo / variant))
from pipeline import PixelFlowPipeline

pipe = PixelFlowPipeline.from_pretrained(".")
pipe.to("cuda")

images = pipe(
    prompt="A golden retriever playing in a sunny garden",
    num_inference_steps=[10, 10, 10, 10],
    guidance_scale=4.0,
).images

Conversion

python scripts/convert_pixelflow_to_diffusers.py \
  --checkpoint models/raw/PixelFlow/c2i/model.pt \
  --config models/raw/PixelFlow/c2i/config.yaml \
  --output models/BiliSakura/PixelFlow-diffusers/PixelFlow-256

python scripts/convert_pixelflow_to_diffusers.py \
  --checkpoint models/raw/PixelFlow/t2i/model.pt \
  --config models/raw/PixelFlow/t2i/config.yaml \
  --output models/BiliSakura/PixelFlow-diffusers/PixelFlow-T2I \
  --skip-text-encoder
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including BiliSakura/PixelFlow-diffusers