Instructions to use hetanshishah/Diffusion-cuneiform with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use hetanshishah/Diffusion-cuneiform with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("hetanshishah/Diffusion-cuneiform", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
๐บ Cuneiform Symbol Generation with Diffusion Models
A diffusion model trained to generate novel Cuneiform symbols, one of the world's earliest known writing systems.
Model
This model uses a UNet2DModel from Hugging Face Diffusers and generates 128ร128 grayscale images of Cuneiform-like symbols.
Architecture
- Model: UNet2DModel
- Input/Output: 1-channel grayscale
- Image size: 128 ร 128
- Channel widths: 128, 128, 256, 256, 512, 512
- Attention: Included at the 512-channel level
- Diffusers version: 0.37.1
Dataset
The base dataset was created from the Cuneiform block of Unicode Standard Version 17.0 (U+12000โU+1239F).
- 922 unique Cuneiform glyphs
- Geometric augmentations were applied to increase variation
- Final dataset: 10,142 images
- Images were cropped, centered, converted to grayscale, and resized to 128ร128
Training
The model was trained locally on an RTX 3050 Laptop GPU.
- Epochs: 30
- Batch size: 16
- Optimizer: AdamW
- Learning rate: 1e-4
- Precision: FP16 mixed precision
- Loss: MSE
- Noise schedule: Linear
- Final dataset: 10,142 images
Results
Three dataset sizes were compared: 922, 5,000, and 10,142 images, using both DDPM and DDIM sampling.
The 10,142-image model produced the strongest results. DDPM sampling generated mostly coherent and visually meaningful Cuneiform-like symbols, capturing features such as wedge-shaped stroke tips and structured stroke layouts.
DDPM produced higher-quality results than DDIM, particularly in fine stroke separation and wedge-tip detail, although it was substantially slower.
The experiments also showed that increasing the dataset from 922 to 5,000 images produced the largest improvement in generation quality.
Limitations
Some generated symbols contain:
- Overly thick or merged strokes
- Faint or fragmented strokes
- Unusual arrangements of otherwise Cuneiform-like structures
The experiments suggest that dilation and erosion augmentations contributed to some of these artifacts.
Files
config.json
diffusion_pytorch_model.safetensors
- Downloads last month
- 12