Downloads · 30 days
0
Pradeep016/StyleGAN-FFHQ
StyleGAN-FFHQ is a unconditional image generation model from Pradeep016. Use it for the unconditional image generation task on the model card, and read the license before you ship it in a product. The card lists the license as cc-by-sa-4.0.
Model Type: Generative Adversarial Network (GAN) Architecture: Custom StyleGAN-inspired variant (Pure PyTorch implementation) Resolution: 128x128 (Inferred based on visual frequency outputs) Parameters: 19M Training H…
Downloads · 30 days
0
Access
Public
Updated Jul 5, 2026
Repo size
465 MB
Likes
3
Public
Click a slice to open those files.
.pt465 MB · 100%
From the Hugging Face model README
This is a custom, from-scratch implementation of a StyleGAN-like architecture built entirely in native PyTorch. It strictly avoids NVIDIA's dnnlib and custom CUDA kernels (such as fused upsample/downsample and upfirdn2d filters).
The primary objective of this model is to serve as a compute-constrained proof-of-concept. It demonstrates that the global manifold of human faces can be successfully mapped using standard PyTorch operations on limited hardware (Kaggle free-tier GPUs), accepting the inherent trade-offs in memory overhead and operational latency.
Due to the architectural and computational constraints, users should expect specific structural anomalies:
Because this repository contains a raw PyTorch .pt state dictionary rather than a Hugging Face compatible class, you must define the network architecture locally before loading the weights.
import torch
import torch.nn as nn
from huggingface_hub import hf_hub_download
# 1. Define the exact Generator architecture used during training
class CustomStyleGANGenerator(nn.Module):
def __init__(self):
super().__init__()
# [USER MUST PASTE THE GENERATOR CLASS CODE HERE]
pass
def forward(self, z):
# [USER MUST PASTE THE FORWARD PASS HERE]
pass
# 2. Download and load the weights
repo_id = "Pradeep016/StyleGAN-FFHQ"
filename = "styleGAN_Model.pt"
weights_path = hf_hub_download(repo_id=repo_id, filename=filename)
# 3. Instantiate and load
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
generator = CustomStyleGANGenerator().to(device)
generator.load_state_dict(torch.load(weights_path, map_location=device))
generator.eval()
# 4. Generate a sample (example using latent dim of 512)
with torch.no_grad():
z = torch.randn(1, 512).to(device)
# Apply truncation psi=0.7 manually if required by your implementation
output_image = generator(z)
