Chimera Compound LLC

Chimera Studio — Product Image Synthesis

Text-driven product photography editing and generation for e-commerce — the platform launched as LayFlat AI and later renamed Chimera Studio — turning a single garment photo into studio-grade flat-lay imagery.

Role
AI & Machine Learning Programmer / Backend Engineer
Period
Oct 2025–Dec 2025

Screens from the running system

  • Flat-lay output 1 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 2 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 3 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 4 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 5 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 6 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 7 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 8 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 9 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 10 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 11 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 12 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 13 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 14 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 15 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 16 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 17 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 18 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 19 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.
  • Flat-lay output 20 of 20 from the fine-tuned pipeline — a garment isolated by segmentation, held fixed, and composited onto a clean studio background.

01 Problem What was actually hard

A seller listing one product needs a dozen variants: different backgrounds, lighting, fits. Each one is either another photoshoot or another hour of manual retouching. Generic text-to-image models do not solve this, because they do not preserve the product: the garment that comes back is not the garment that went in. The system had to understand which pixels are the product, hold that region fixed, and change everything around it — at gallery resolution and inside an interactive wait.

02 Data Sourcing and preparation

Collected 10,000+ product images across clothing, accessories, pants, shoes, caps and belts — each shot from multiple angles — with manual annotation: bounding boxes for the product region, segmentation masks for folds and shadows, background category, light direction and capture angle. Augmentation (brightness, contrast, rotation, perspective) simulated shooting conditions the source set did not cover. A ground-truth set of photographer-approved edits was held back as the acceptance gate for model selection.

03 Models Evaluated, kept, cut

8 evaluated 5 kept 3 cut

Kept 5

  • SegFormer (clothes)

    Semantic segmentation isolates the garment region before anything is generated

  • ControlNet

    Edge and depth maps constrain generation to the real product contour

  • InstructPix2Pix

    Instruction-following edits; fine-tuned on the product set for clothing

  • Stable Diffusion XL

    Background synthesis at 1024px and above

  • Real-ESRGAN

    Upscaling and artefact removal on the final frame

Cut 3

  • DALL-E 3

    No fine-tuning hook, and it distorts the product it was asked to preserve

  • Runway Gen-2

    Video generation — wrong tool, and priced for a different problem

  • Runway Inpainting v1

    Visible seams at the mask edge; replaced by the ControlNet + SDXL chain

04 Architecture How it fits together

A staged pipeline rather than one model: SegFormer segments the product, ControlNet derives spatial priors from that mask, InstructPix2Pix applies the text edit inside the constrained region (or SDXL synthesises a new background around it), and Real-ESRGAN finishes the frame. Prompts are assembled from few-shot exemplars plus product-specific descriptors. Repeated prompt/image pairs are served from a Redis cache instead of re-running the chain. An A/B test settled the routing rule: InstructPix2Pix wins on garment edits, SDXL wins on backgrounds, so requests are dispatched by edit type.

Architecture flow: Source photo then SegFormer then ControlNet then Edit or synthesise then Real-ESRGAN then Signed S3 URL 01 Source photo uploaded from the mobile client 02 SegFormer segment the product region 03 ControlNet edge + depth priors from the mask 04 Edit or synthesise InstructPix2Pix for garments, SDXL for backgrounds 05 Real-ESRGAN upscale, artefact removal 06 Signed S3 URL preview and download

05 Production Deployment and operation

Stateless API on AWS Lambda in front of GPU workers on g4dn instances; iOS and Android clients post an image and a prompt over REST and receive a signed S3 URL for preview and download. Monitoring covers inference latency, upscale quality and retention.

06 Deep dive The long version, in full

Problem

E-commerce sellers face an uncomfortable truth: professional product photography is expensive and time-consuming. A single product might need 10–20 variations (different colors, lighting, backgrounds, model fits) requiring either multiple photoshoots or tedious manual editing. AI-powered image synthesis could automate this workflow—but the challenge lies in quality, speed, and control.

Generic text-to-image models (DALL-E, Midjourney) generate beautiful but unpredictable images; they don’t preserve product structure, and their outputs often look “too polished” (not realistic enough for e-commerce). We needed a system that understands product regions, respects spatial constraints, and produces gallery-ready images in seconds—not minutes.

Data Preparation

We worked with e-commerce partners to gather 10,000+ product images spanning clothing, accessories, pants, shoes, caps and belts, each captured from multiple angles. Every image was manually annotated:

  • Bounding boxes for product regions
  • Segmentation masks for clothing folds and shadows
  • Background patterns (studio, lifestyle, white-wall, etc.)
  • Light direction and intensity
  • Capture angle, so the model learns the product rather than one fixed viewpoint

We created a ground-truth evaluation set of 500 professionally-edited examples (photographer-approved comparisons). This became our gold standard for model selection.

Synthetic data augmentation expanded the training set: random brightness/contrast shifts, rotations, and perspective transforms simulated different shooting conditions.

Models Evaluated

Model Result Rationale
InstructPix2Pix Kept Text-guided editing; preserves structure; fine-tuned on clothing fits
Stable Diffusion XL Kept High-res generation; used for backgrounds and synthetic variation
ControlNet Kept Spatial priors (edge maps, depth); constrains generation to product contour
SegFormer Kept Semantic segmentation; isolates product before editing
Real-ESRGAN Kept Upscaling and artifact removal; polishes final output
DALL-E 3 Cut High cost/latency; no fine-tuning; unpredictable product distortion
Runway Gen-2 Cut Designed for video; overkill and expensive
Runway Inpainting v1 Cut Poor edge blending; replaced by our ControlNet+SDXL chain

Architecture

The inference pipeline operates in stages:

  1. Product Detection: SegFormer segments the product region
  2. Spatial Priors: ControlNet generates edge/depth maps to constrain generation
  3. Guided Editing: InstructPix2Pix applies text edits (e.g., “remove shadow, bright studio lighting”) or SDXL synthesizes entirely new backgrounds
  4. Polish: Real-ESRGAN upscales and removes artifacts

Prompts are engineered via few-shot examples: “Product: premium cotton shirt. Lighting: bright studio, 45° key light. Background: clean white. Style: e-commerce gallery.”

A caching layer (Redis) stores model outputs for repeated prompts, reducing redundant inference.

Production & Scale

Launched on AWS Lambda (stateless API) with GPU workers on g4dn instances. Mobile clients (iOS/Android) submit images + text prompts via REST. Outputs are persisted to S3 with signed URLs for instant preview and download.

Key metrics: <10s inference per image, 1080p standard (4K optional), 99.7% uptime.

An A/B test revealed a surprising insight: InstructPix2Pix excels at clothing edits, while SDXL is superior for backgrounds. We now route requests conditionally: product editing -> InstructPix2Pix; background-only synthesis -> SDXL.

Result: 24,000+ users on iOS/Android. Repeat usage rate: 68%. Avg. editing time reduced from 15 min (manual) to <1 min (AI-assisted).

inference time
under 10s per image
output
1080p standard, 4K optional