AI Image Agent: Automated Fashion Setcard Generation
Built an AI-powered pipeline that turns a fashion retailer's product photos and Excel data into reviewed, export-ready setcard images.
Overview
A web application for a fashion retailer that automates the production of model setcard images from existing product photography. Merchandisers upload an Excel sheet and product photos; the system generates styled on-model images via AI image generation providers, routes them through a human review step, and exports approved results as named, metadata-tagged files ready for downstream use.
Problem
Producing setcard imagery for every article, colour, and view manually is slow and expensive: each new collection requires photo shoots or manual editing, and output files must follow strict naming conventions to fit the retailer's existing workflow.
Constraints
- Generated images had to be based on the retailer's real product photos, including multi-article outfit combinations
- Output files must follow the client's exact naming conventions and include full provenance metadata
- AI output cannot ship unreviewed—a human approval step is mandatory
- Runs on the client's own infrastructure, deployed and configured via Ansible
Approach
Built an Astro SSR application with a SQLite-backed job queue that walks each article through a pipeline: Excel import, reference photo matching, AI image generation, human review, and ZIP export. Image generation sits behind a provider abstraction so different backends (diffusion models and virtual try-on services) can be switched per environment variable or compared side by side. Every generated JPEG is stamped with EXIF/IPTC metadata—article number, colour, view, model, and the generation prompt—so provenance survives outside the system.
Key Decisions
Abstract image generation behind a provider interface
The AI image-generation landscape changes fast; swapping or comparing providers via configuration avoids rewrites and lock-in.
- Hard-code a single generation API
Use SQLite with an in-process job queue instead of a separate database and worker stack
A single-node deployment for one client does not need distributed infrastructure; fewer moving parts means simpler operations on the client's server.
- PostgreSQL plus a dedicated queue/worker service
Embed provenance metadata directly into generated images
Files leave the system as ZIP exports; embedded EXIF/IPTC metadata keeps article, model, and prompt information attached to each image wherever it ends up.
Keep a mandatory human review step in the pipeline
AI-generated fashion imagery needs editorial judgement before publication; the pipeline treats generation as a draft stage, not a final output.
Tech Stack
- Astro (SSR)
- TypeScript
- SQLite (better-sqlite3)
- AI image generation (diffusion and virtual try-on providers)
- sharp / exiftool
- Tailwind CSS
- Ansible
Result & Impact
Reduced setcard production from a manual photo-editing task to an upload-generate-review workflow: a collection's worth of articles can be processed in one pipeline run, with consistent naming and traceable metadata on every exported image.
Learnings
- Provider abstractions pay off quickly in the AI space, where the best available model changes every few months
- Human review belongs in the pipeline design from the start, not bolted on after generation quality disappoints
- Embedding metadata in the artifacts themselves beats relying on databases the artifacts will outlive