Elias Bellouti
FR
← Back to projects

Personal project · Image generation

Clothify : garment images on models

Clothify starts with a garment photo and produces an image for presenting it on a person. Users submit their image in Discord, choose the garment type, build and view, then receive the result in the same channel. I developed that journey and connected the bot to PostgreSQL, n8n and an image model. Requests and processing states form a contract between components, letting generation evolve independently of the interface while distinguishing a finished image from one actually delivered to its user.

Working bot video; two garments shown from four saved angles in the demo.

Screen recording of the Clothify Discord bot: a garment photo is submitted, the bot answers with a job id and the parsed parameters, then posts the generated visual into the channel.

Starting with a garment photo

I created Clothify to generate an image of someone wearing a garment from an existing product photo. Discord provides the entry point: users submit an image, choose the garment, person, build and viewing angle, then receive the result in the conversation.

I designed menus, buttons and additional text input so users can make these choices without handling API parameters. Interactions belong to the person who submitted the request, and a job identifier makes the work traceable. The garment type also accepts a description when the predefined menu is not sufficient.

Separating requests from generation

The Python bot saves the file and a request in PostgreSQL. A database notification wakes the n8n workflow, which prepares the parameters, builds the prompt, calls the model through OpenRouter and saves the returned image. The bot then checks processing state to deliver the result in Discord.

I chose notification-based triggering for the start and straightforward polling for delivery. The database distinguishes completed generation from completed delivery. The bot relies on that data contract; image API details stay in n8n. Changing models can therefore be handled in the generation workflow, without rewriting the Discord interaction.

Connecting user choices to the image

The selected angle becomes a camera instruction. The prompt asks the model to preserve the garment, fabric and logos, frame below the face and remove interface elements surrounding a source screenshot. These instructions guide generation; surfaces absent from the source photo still require interpretation by the model.

I worked on problems at the boundaries between components. A fixed camera instruction could contradict the selected view. A late state update could mark a completed job as processing again and prevent delivery. I corrected prompt construction and transition ordering, then unified shared-volume paths so the bot and n8n refer to the same files across their environments.

Keeping the integration changeable

Business settings are separated from environment configuration. n8n exports are versioned with the code so the generation logic is available for rebuilding the service. The project documentation explains these contracts and the model-switching procedure.

The video shows the Discord bot. The portfolio demo offers two garments in four saved views that can be explored for free. Its access-code generation calls the image model directly, separately from the Discord, PostgreSQL and n8n workflow. I kept that distinction so visitors can inspect the examples without starting another generation.

Skills applied in this project

Software architecture

I decoupled the Discord bot from n8n generation through a PostgreSQL data contract, so the model can change without rebuilding the user workflow.

Data ingestion and automation

I connected the Discord workflow to a PostgreSQL job, then to the n8n workflow that generates the image and prepares it for delivery.

Testing, evaluation and reliability

I corrected transition ordering to preserve the completed-generation state, then defined an acceptance check for both the job status and output file.

← Back to projects