Downloads · 30 days
0
louijiec/ddpm-pixelwing
ddpm-pixelwing is a unconditional image generation model from louijiec. Use it for the unconditional image generation task on the model card, and read the license before you ship it in a product. It is set up for diffusers. The card lists the license as apache-2.0.
This repository contains a Denoising Diffusion Probabilistic Model (DDPM) trained from scratch to generate 8-bit style pixel art images of wings. This model was built using the Hugging Face diffusers library.
Downloads · 30 days
0
Access
Public
Updated Jun 13, 2025
Repo size
2.7 MB
Likes
1
Public
Click a slice to open those files.
.png2.4 MB · 91%
From the Hugging Face model README
This repository contains a Denoising Diffusion Probabilistic Model (DDPM) trained from scratch to generate 8-bit style pixel art images of wings. This model was built using the Hugging Face diffusers library.
The model is "unconditional," meaning it generates random wing designs without any specific text or image prompt. It's a fun tool for artists, game developers, or anyone needing inspiration for pixel art sprites.
Denoising Diffusion Probabilistic Models (DDPMs) are a class of generative models that learn to create data by reversing a gradual noising process. The model learns to denoise an image from pure Gaussian noise, step by step, until a clean, coherent image emerges.
This specific model is based on the architecture proposed in the paper Denoising Diffusion Probabilistic Models and is implemented as a UNet2DModel in the diffusers library. It was trained on a custom dataset of 8-bit style wing images.
Model Architecture:
UNet2DModelsample_size: 32in_channels: 3out_channels: 3layers_per_block: 2block_out_channels: (64, 128, 128, 256)down_block_types: (DownBlock2D, DownBlock2D, AttnDownBlock2D, DownBlock2D)up_block_types: (UpBlock2D, AttnUpBlock2D, UpBlock2D, UpBlock2D)This model is primarily intended for creative applications, such as:
The model can be used as-is for unconditional generation or as a base model for further fine-tuning on a more specific dataset of pixel art.
You can easily use this model for inference with just a few lines of code using the diffusers library.
First, make sure you have the necessary libraries installed.
pip install --upgrade diffusers transformers accelerate torch
The following Python script demonstrates how to load the model from the Hugging Face Hub and generate an image.
import torch
from diffusers import DDPMPipeline
from PIL import Image
# For reproducibility
generator = torch.manual_seed(42)
# Load the pretrained pipeline from the Hub
pipeline = DDPMPipeline.from_pretrained("louijiec/ddpm-pixelwing")
# If you have a GPU, move the pipeline to the GPU for faster generation
if torch.cuda.is_available():
pipeline = pipeline.to("cuda")
print("Pipeline loaded. Starting image generation...")
# Run the generation process
# The pipeline returns a dataclass with the generated image
result = pipeline(generator=generator, num_inference_steps=1000)
image = result.images
# The output is a PIL Image, which you can display or save
print("Image generated successfully.")
image.save("pixel_wing.png")
# To generate a batch of images, you can specify `batch_size`
# images = pipeline(batch_size=4, generator=generator).images
# for i, img in enumerate(images):
# img.save(f"pixel_wing_{i+1}.png")
This script will generate a 32x32 pixel art wing and save it as pixel_wing.png in your current directory.
This model was trained from scratch. The following provides an overview for those interested in the training process or looking to reproduce it.
Library: The model was trained using the official diffusers unconditional image generation training script.
Dataset: The model was trained on a custom dataset named "PixelWing", consisting of approximately 300 unique 32x32 pixel art images of wings. The images were created and curated specifically for this project.
Training Procedure: