Training and inference code for my first real Model, following the HF diffusion model course.
It's an unconditional 128×128 DDPM that generates
painterly abstract images. The resulting diffusion model is published in the HF repository.
![]() |
![]() |
![]() |
Run inference (assuming PyTorch and Diffusers are installed and the HF repo is downloaded to the same parent directory) from this directory with:
python inference.pyWhich will generate 3 images at 500 steps each. For faster exploration, use 100 inference steps. Around 250 steps provides a useful speed/quality balance, while 500 steps gives more time to final renders.
The Model was trained on a 36 GB M3 Max Mac in approx. 5 hours. The dataset is a ~7600 Row subset of Wikiart filtered for images under 2400px.
The images are resized to 128x128 and preprocessed, training then takes place over 20 epochs with a batch size of 8. The training script is train.py and can be run with:
python train.pywhich assumes the above parameters. Before training the images have to be downloaded and preprocessed with:
python load_dataset.pywhich as mentioned above streams the dataset to filter for images under 2400px and resizes them to 128x128. The resulting dataset is saved in ./wikiart_under_2400_resized_dataset. The loading process can be interrupted at any time if the desired amount of images has been downloaded.


