CoolFace
Apppublic

azam897/Diffusion-Model

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
App README

DDPM: Denoising Diffusion Probabilistic Model

Trained on CelebA-HQ 256×256 · AI4009 Generative AI · Spring 2026 · NUCES


What this app does

TabDescription
Generate from NoiseRuns the full reverse diffusion process starting from random Gaussian noise and produces a 256×256 face image. Supports both DDPM (full quality, 300 steps) and DDIM (fast, configurable steps).
Reconstruct ImageUpload any face image, partially corrupt it with forward diffusion, then reconstruct it using the model.

Model Details

PropertyValue
ArchitectureU-Net with Residual Blocks & Self-Attention
Channel progression64 → 128 → 256
Residual blocks per level2
Attention resolution32×32
Timesteps300
Noise scheduleLinear (β₀=0.0001 → β_T=0.02)
DatasetCelebA-HQ 256×256
Training epochs40
Best loss0.0199
OptimizerAdamW + CosineAnnealingLR
Loss functionMSE on predicted noise

Model Weights

Weights are loaded automatically at startup from 👉 `shahem1/AI4009-DDPM-Model` (best_model.pt)


Quick Usage (Python)

python
from huggingface_hub import hf_hub_download
import torch

ckpt = hf_hub_download("shahem1/AI4009-DDPM-Model", "best_model.pt")
checkpoint = torch.load(ckpt, map_location="cpu")

# Instantiate UNet with the same config, then:
model.load_state_dict(checkpoint["model_state_dict"])
model.eval()