""" Minimal Hebrew word sampler for cyttic/diffusionpen-matan-ft (DiffusionPen fine-tuned on Hebrew handwriting). Everything is fetched from the Hugging Face Hub on first run: - UNet EMA checkpoint, style encoder, vocab/writer maps <- cyttic/diffusionpen-matan-ft (this repo) - reference word crops (5 per writer drive the style) <- cyttic/matan-hebrew-handwriting-words - VAE + DDIM scheduler <- stable-diffusion-v1-5/stable-diffusion-v1-5 - CANINE tokenizer/config <- google/canine-c Usage: python sample.py --text "שלום עולם" --style w100 --n 2 python sample.py --text "שלום" --refs a.png b.png c.png d.png e.png # your own style references Images are written to ./samples/_