Downloads · 30 days
33
15% of all-time downloads
starkdv123/mnist-28px-text2img
mnist-28px-text2img is a text-to-image model from starkdv123. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as mit.
This repository provides a minimal diffusion model for generating MNIST digits (0–9) from text prompts. It uses a tiny UNet with FiLM conditioning and Classifier-Free Guidance (CFG).
Downloads · 30 days
33
15% of all-time downloads
All-time downloads
224
Public
Parameters
1.5M
6 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors6 MB · 98%
From the Hugging Face model README
This repository provides a minimal diffusion model for generating MNIST digits (0–9) from text prompts. It uses a tiny UNet with FiLM conditioning and Classifier-Free Guidance (CFG).
from huggingface_hub import snapshot_download
import importlib.util, sys, os
local_dir = snapshot_download("starkdv123/mnist-28px-text2img")
pipe_path = os.path.join(local_dir, "pipeline_mnist.py")
spec = importlib.util.spec_from_file_location("pipeline_mnist", pipe_path)
mod = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = mod
spec.loader.exec_module(mod)
Pipe = getattr(mod, "MNISTTextToImagePipeline")
pipe = Pipe.from_pretrained(local_dir)
img = pipe("seven", num_inference_steps=120, guidance_scale=2.5).images[0]
img.save("seven.png")
from huggingface_hub import snapshot_download
import sys
local_dir = snapshot_download("starkdv123/mnist-28px-text2img")
sys.path.append(local_dir)
from pipeline_mnist import MNISTTextToImagePipeline as Pipe
pipe = Pipe.from_pretrained(local_dir)
from diffusers import DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained("starkdv123/mnist-28px-text2img", custom_pipeline="pipeline_mnist")
# Note: requires diffusers>=0.30 and may still be sensitive to custom components.
(x - 0.5) / 0.5 → network predicts noise in [-1,1]model.safetensors — trained UNet weightsconfig.json — model hyperparametersscheduler_config.json — noise schedulepipeline_mnist.py — custom pipeline definitionmodel_index.json — metadata for Diffuserssamples/grid_0_9.png — final 0–9 gridsamples/grid_e*.png — per‑epoch grids (training progress)
