Skip to content

timothe/Product-Catalog-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bria 3×3 Catalog Generator

This Flask app turns a single product photo into a 3×3 lifestyle collage (PNG + PDF) using Bria’s Product Shot Editing APIs.

Features

  • Upload one product image (JPG/PNG/WebP ≤ 12 MB).
  • Server-side creates a transparent packshot, then nine lifestyle variations with different placements.
  • Results saved under static/outputs/<session_id>/:
    • items/1.pngitems/9.png
    • grid.png (3×3 montage)
    • catalog.pdf
  • Background worker tracks progress; front-end polls /progress/<job_id>.
  • Guards against oversized uploads and oversized downloads from Bria.

Prerequisites

  • Python 3.11+
  • Bria API token with access to the Lifestyle endpoints.

Setup

python3 -m venv .venv
. .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt

export BRIA_API_TOKEN=your_token_here  # Powers all API calls

Run the App

flask --app app.py run --reload

Then open http://127.0.0.1:5000.

Project Structure

app.py                  # Flask app, background job orchestration
templates/              # index, progress, result pages
static/css/styles.css   # UI styling
static/outputs/         # Generated results (per session)
requirements.txt        # Python dependencies

Key Environment Variables

  • BRIA_API_TOKEN (required): Auth token for Bria APIs.

Security Notes

  • File uploads are size-limited to 12 MB before any processing.
  • Downloads from Bria are streamed and capped at 25 MB to avoid memory exhaustion.
  • Werkzeug access logs are suppressed (warnings and above only) so app logs stay readable.

Troubleshooting

  • 403 response from Flask: check that app.py ran successfully and the templates are accessible.
  • Bria API errors: confirm the token is valid and that your account has access to the Lifestyle endpoints.
  • Oversized upload error: resize the source image to ≤ 12 MB.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors