Original size 2280x3200

ReTouche. Generative Object Manipulation

PROTECT STATUS: not protected
The project is taking part in the competition

This is…

Project Concept

Image Generation

The Stable Diffusion neural network model was selected for image generation, and it needed to be trained to process object photographs in this specific style. To fine-tune the model, 22 photographs of objects with blurred treatments in a 1:1 aspect ratio were used. The dataset predominantly featured close-up shots of objects illuminated by high-contrast studio lighting.

For the initial quality assessment of the model, we used the simplest possible prompts. This allowed us to generate images most closely aligned with the training set, thereby testing how well the model had absorbed the visual characteristics of the processing.

The model demonstrated good results. To prevent overfitting and identify optimization points, we will evaluate the quality of its performance at intermediate training stages.

big
Original size 1024x1024

The image shows that the model does not exhibit clear overfitting. It has already learned the basic general features of the main object but cannot yet render it accurately (object blending). Since the intermediate result is noticeably worse than the final one, we can conclude that increasing the number of training steps will likely achieve even higher quality.

For the final generation stage, a model trained with 1,000 steps was selected. The text prompts were augmented with detailed descriptions and keywords corresponding to specific, important visual effects.

Original size 1024x1024
Original size 1024x1024
Original size 1024x1024
Original size 1024x1024
Original size 1024x1024
Original size 1024x1024
Original size 1024x1024
Original size 1024x1024
Original size 1024x1024

Code Operation Principle

To begin, we will install all necessary libraries, and then we will review several random photographs from the dataset to assess the quality of the execution.

Next, using BLIP, textual descriptions were automatically generated for every image in the dataset, which were then used as prompts. This requirement stems from the architecture of Stable Diffusion, which strictly mandates paired data (text prompt and image) for training.

Next, the model training begins. I set an increased number of steps—1000—so the model can produce a higher quality result. Additionally, a prefix identifier, which was present in the training set, is always added to the prompts to create more precise effects.

I am saving the model to Hugging Face, where images can be generated. Alternatively, the model can be transferred to a GPU, which allows image generation directly within the computer’s environment. Kaggle was chosen as the platform, so code to automatically save the generated images to the working folder with the ability to download them later was included in the project.

ReTouche. Generative Object Manipulation
Project created at 21.10.2026