Project Idea
The project focuses on training the Stable Diffusion neural network model in the style of medieval Gothic stained glass windows, characteristic of 12th–13th century French cathedrals. The most prominent examples of this art are preserved in Notre-Dame Cathedral. The distinctive features of this style include minimalism, a limited color palette dominated by cobalt blue, and clear, high-contrast graphic quality.

Fragment 121, Rose, Notre Dame Cathedral

Notre Dame de Paris
Stained glass windows are composed of numerous individual glass fragments assembled into a unified biblical narrative or parable. To train the model, a database was prepared consisting not of complete stained glass panels, but of small, circular fragments from them, which will allow for more detailed and accurate image generation.

Fragments of stained glass
Fragments of stained glass panels
Model training process
Approximately 150 stained glass fragments were selected to train the generative neural network, and then cropped to a 1:1 ratio.
Google Colab Code Snippet
Google Colab code snippet
Google Colab Code Snippet
The first stage included: checking the GPU, installing dependencies, creating a local directory, and uploading images to Google Colab.
Google Colab Code Snippet
Google Colab Code Snippet
Then, the BLIP model generated image descriptions, to which a prefix was added to stylize them like a medieval stained-glass window. This combined textual data served as the foundation for training the subsequent model.
Google Colab Code Snippet
Google Colab Code Snippet
Following this, the model training process was initiated using the LoRA method, which took approximately two hours with the specified settings.
Google Colab Code Snippet
Google Colab code snippet
Google Colab Code Snippet
Upon completion of the training, the model is saved, uploaded to the Hugging Face Hub platform, and becomes available for use. From there, you can begin creating images.
Image Series
Based on the initial generation tests, I have noticed that the neural network effectively captures the form and overall style, but the image quality deteriorates significantly due to the excessive mosaic fragments and chips rendered by the generation.
In the next generation, the checkpoint strength was decreased to -250, which helped produce cleaner images.




