Downloads · 30 days
0
jalpan04/Pixel_Diffusion
Pixel_Diffusion is a image-to-image model from jalpan04. Use it when you need one image transformed into another. It is set up for pytorch. The card lists the license as mit.
[](https://www.python.org/downloads/) [](https://pytorch.org/) [](https://opensource.org/licenses/MIT) [](https://gradio.app/)
Downloads · 30 days
0
Access
Public
Updated May 11, 2026
Repo size
17.4 MB
Likes
0
Public
Click a slice to open those files.
.pth17.4 MB · 100%
From the Hugging Face model README
A conditional Denoising Diffusion Probabilistic Model (DDPM) for generating 16x16 pixel art sprites with class-based control and real-time visualization.
This project operates in two phases: a training phase (detailed in Training.ipynb) and an inference/application phase (detailed in app.py). The model from the first phase is loaded into the second to create an interactive application for generating pixel art sprites.
The core of this project is a conditional Denoising Diffusion Probabilistic Model (DDPM). The process can be broken down into data handling, model architecture, training, and inference.
PixelArtDataset class in the training notebook is custom-built for this data.DiffusionSchedule class implements a cosine noise schedule. This defines how noise is added to an image over T=1000 timesteps. The model's job is to learn how to reverse this process, starting from pure noise and gradually denoising it back to a clean image.ContextUNetThe model's "brain" is the ContextUNet. This architecture is specifically designed to handle and be controlled by external information.
x_t)t)c): The control mechanism (e.g., "Characters" or "Monsters").emb = t_emb + c_emb) and injected into every ResidualBlock. This ensures the model is constantly reminded of the target category and current noise level.The training loop teaches the model to predict the original noise added to a clean image.
x and label c.t.t, and c into the ContextUNet.MSE) between predicted and actual noise.Using Classifier-Free Guidance (CFG) for explicit control:
T-1 to 0.eps = eps_uncond + guidance_scale * (eps_cond - eps_uncond).This project is licensed under the MIT License.
Inspiration drawn from modern diffusion research including DDPM and CFG techniques.