Longread translated automatically
Original size 1000x1410

Training a Generative Model for Creating Gothic Stained Glass

Idea

I wanted to train a neural network to create Gothic stained-glass windows so that I could use it to generate scenes from contemporary urban life.

Original size 1152x768

Source Images

Photographs of stained glass from Wikimedia Commons were used as the source images.

Learning Outcome

Original size 1024x1024

A barista making coffee behind a counter, roundel composition

What Turned Out Well The network learned the stained-glass form: thick black outlines of lead cames, mosaic segmentation of the glass, ornamental frames, flat figures in medallions and pointed arches, in rich red, blue, and ochre. Scenes like «cyclist in a round window» or «guitarist in a red frame» particularly suit this style: the round frame connects them to the Gothic rosettes from the training set.

a student with a laptop and coffee in a library // a Yandex yellow courier delivering a package to a doorstep

The neural network saves objects (bicycle, guitar, coffee cup, laptop on the table) but dresses the people in medieval robes and habits. This creates the project’s signature contrast: a laptop in a monk’s hands, a bicycle under a person in a red hood. A notable side effect is the halos. Because the training set consists of saints, the barista and the musician develop a halo around their heads, like saints.

Original size 1024x1024

A cyclist riding through the city, roundel composition

A street musician with a guitar // two alternative goths on a bench sitting in sadness

What Didn’t Work Perspective: On the stage with a long arcade, deep space returns, which is absent in the actual stained glass. Small, modern details are drawn conditionally. The storylines are lost at full weight.

a tram crossing a city bridge // a person walking a dog in the city park

Original size 768x1024

a cyclist riding through the city

The Learning Process

Initially, I gathered the dataset using Claude. The resulting script filtered the images by license to avoid copyright infringement.

Data Preparation: Automatic collection from Commons (filters based on license and keywords, sharpness, brightness, duplicates, CLIP verification). Captions were generated by the BLIP model and cleaned to remove religious terms, ensuring the style did not clash with the subject matter. Each caption included the trigger «gothic stained glass style.»

Original size 2048x512

A barista making coffee behind a counter, roundel composition

After training the model, we compared the generation results across various LoRA strength values: 0.0, 0.5, and 1.0.

For the final series, we selected the 0.5 value because it achieved a superior balance between the specific characteristics of the trained stained-glass style and the capabilities of the base Stable Diffusion XL model.

The comparison image demonstrates the positive impact of the trained neural network: the faces are significantly more realistic and resemble Gothic stained glass, and this improvement extends to the fabric, objects, and glass texture.

Description of Generative Model Application

Stable Diffusion XL base 1.0, fine-tuned using LoRA: final image generation. URL: huggingface.co/stabilityai/stable-diffusion-xl-base-1.0SDXL VAE fp16 fix: stable operation in fp16. URL: huggingface.co/madebyollin/sdxl-vae-fp16-fixBLIP: automatic captions for the dataset. URL: huggingface.co/Salesforce/blip-image-captioning-baseCLIP: dataset filtering (removing frames without stained glass). URL: huggingface.co/openai/clip-vit-base-patch32Claude (Anthropic): assistance with concept formulation and text writing, dataset collection script, and notebook adaptation. URL: claude.ai

The training set (58 images) was compiled from Wikimedia Commons. Only files licensed under CC0 and in the public domain were used.

Training a Generative Model for Creating Gothic Stained Glass
Project created at 28.10.2026
hsespacecreative.deziiign
The digital ecosystem of HSE Institute for Creative Industries Development, combining a professional portfolio for students, graduates and employees of the bachelor’s and master’s degree programmes «Management in Creative Industries», an online educational platform, and a hub that aggregates international competitions in creative industries, among other digital services for creatives. ... Show more
We use cookies to improve the operation of the HSE website and to enhance its usability. More detailed information on the use of cookies can be fou...
Show more