Skip to content
ModelListedExternal
Download

Cfm Cifar10 32

A flow matching model for unconditional image generation trained on the CIFAR-10 dataset. This model uses continuous normalizing flows with the FlowMatchEulerDiscreteScheduler for efficient sampling.

KindOtherBase modelgoogle/ddpm-cifar10-32VersionDiffusion pytorch modelBgrade

Model source

Kind
Other
File size
136 MB
Base model
google/ddpm-cifar10-32
Version
vDiffusion pytorch model
Updated
Oct 9, 2026
Source
Hugging Face

Source description

Flow Matching CIFAR-10 Model

A flow matching model for unconditional image generation trained on the CIFAR-10 dataset. This model uses continuous normalizing flows with the FlowMatchEulerDiscreteScheduler for efficient sampling.

Model Details

  • Architecture: UNet2DModel with flow matching
  • Dataset: CIFAR-10 (32x32 RGB images)
  • Scheduler: FlowMatchEulerDiscreteScheduler
  • Training Steps: 1000 timesteps
  • Framework: Diffusers 0.35.0.dev0

Flow Matching Configuration

The model uses FlowMatchEulerDiscreteScheduler with the following key parameters:

  • Base shift: 0.5
  • Shift: 1.0 (exponential time shifting)
  • Base image sequence length: 256
  • Max image sequence length: 4096
  • Stochastic sampling: Disabled for deterministic generation

Usage

Basic Generation

from diffusers import DDPMPipeline

# Load the flow matching model
pipeline = DDPMPipeline.from_pretrained("FrankCCCCC/cfm-cifar10-32")

# Generate an image
image = pipeline().images[0]
image.save("generated_cifar10.png")

Custom Inference Steps

from diffusers import DDPMPipeline

pipeline = DDPMPipeline.from_pretrained("FrankCCCCC/cfm-cifar10-32")

# Generate with custom number of inference steps
num_inference_steps: int = 1000
pipeline.scheduler.set_timesteps(num_inference_steps)
image = pipeline().images[0]
image.save("fast_generated_cifar10.png")

Batch Generation

from diffusers import DDPMPipeline

pipeline = DDPMPipeline.from_pretrained("FrankCCCCC/cfm-cifar10-32")

# Generate multiple images at once
images = pipeline(batch_size=4).images
for i, image in enumerate(images):
    image.save(f"generated_cifar10_{i}.png")

Flow Matching vs Standard Diffusion

This model implements flow matching, which offers several advantages over standard diffusion models:

  • Faster sampling: More efficient ODE solving with fewer steps
  • Better training stability: Continuous normalizing flows provide smoother optimization
  • Flexible scheduling: Exponential time shifting for improved sample quality

Model Architecture

  • UNet: Standard UNet2DModel for denoising/flow prediction
  • Scheduler: FlowMatchEulerDiscreteScheduler with exponential time shifting
  • Output: 32x32 RGB images matching CIFAR-10 distribution

Requirements

pip install diffusers torch torchvision

Samples

  1. sample_1
  2. sample_2
  3. sample_3
  4. sample_4
  5. sample_5

Citation

If you use this model, please cite the original flow matching and diffusion literature:

@inproceedings{DDPM,
  author = {Ho, Jonathan and Jain, Ajay and Abbeel, Pieter},
  booktitle = {Advances in Neural Information Processing Systems},
  title = {Denoising Diffusion Probabilistic Models},
  url = {https://proceedings.neurips.cc/paper_files/paper/2020/file/4c5bcfec8584af0d967f1ab10179ca4b-Paper.pdf},
  year = {2020}
}

@inproceedings{FM,
  title={Flow Matching for Generative Modeling},
  author={Yaron Lipman and Ricky T. Q. Chen and Heli Ben-Hamu and Maximilian Nickel and Matthew Le},
  booktitle={The Eleventh International Conference on Learning Representations },
  year={2023},
  url={https://openreview.net/forum?id=PqvMRDCJT9t}
}

Sources

1 source
Hugging FacePrimaryVersion 391ee0652cbb7e3445ab309430bf803a980c1d2f
huggingface.co/chejps980927/cfm-cifar10-32/tree/391ee0652cbb7e3445ab309430bf803a980c1d2f

Verified Oct 9

Model artifacts

1 artifact

unet/diffusion_pytorch_model.safetensors

safetensors · 136 MB · SHA-256 97d25692dbd3…2980 · Hugging Face

Download file

Source excerpts

2 excerpts

--- license: apache-2.0 tags: - pytorch - diffusers - unconditional-image-generation datasets: - uoft-cs/cifar10 language: - en base_model: - google/ddpm-cifar10-32 pipeline_tag: unconditional-image-generation library_name: diffusers --- # Flow Matching CIFAR-10 Model A flow matching model for unconditional image generation trained on the CIFAR-10 dataset. This model uses continuous normalizing flows with the FlowMatchEulerDiscreteScheduler for efficient sampling. ## Model Details - **Architecture**: UNet2DModel with flow matching - **Dataset**: CIFAR-10 (32x32 RGB images) - **Scheduler**: FlowMatchEulerDiscreteScheduler - **Training Steps**: 1000 timesteps - **Framework**: Diffusers 0.35.0.dev0 ## Flow Matching Configuration The model uses FlowMatchEulerDiscreteScheduler with the following key parameters: - **Base shift**: 0.5 - **Shift**: 1.0 (exponential time shifting) - **Base image sequence length**: 256 - **Max image sequence length**: 4096 - **Stochastic sampling**: Disabled for deterministic generation ## Usage ### Basic Generation ```python from diffusers import DDPMPipeline # Load the flow matching model pipeline = DDPMPipeline.from_pretrained("FrankCCCCC/cfm-cifar10-32") # Generate an image image = pipeline().images[0] image.save("generated_cifar10.png") ``` ### Custom Inference Steps ```python from diffusers import DDPMPipeline pipeline = DDPMPipeline.from_pretrained("FrankCCCCC/cfm-cifar10-32") # Generate with custom number of inference steps num_inference_steps: int = 1000 pipeline.scheduler.set_timesteps(num_inference_steps) image = pipeline().images[0] image.save("fast_generated_cifar10.png") ``` ### Batch Generation ```python from diffusers import DDPMPipeline pipeline = DDPMPipeline.from_pretrained("FrankCCCCC/cfm-cifar10-32") # Generate multiple images at once images = pipeline(batch_size=4).images for i, image in enumerate(images): image.save(f"generated_cifar10_{i}.png") ``` ## Flow Matching vs Standard Diffusion This model implements flow matching, which offers several advantages over standard diffusion models: - **Faster sampling**: More efficient ODE solving with fewer steps - **Better training stability**: Continuous normalizing flows provide smoother optimization - **Flexible scheduling**: Exponential time shifting for improved sample quality ## Model Architecture - **UNet**: Standard UNet2DModel for denoi...

Source context: 1 downloads · 0 likes · Pipeline unconditional-image-generation · Library diffusers · Repo chejps980927/cfm-cifar10-32