Multi-agent AI system for automated advertisement poster generation using SAM-HQ, Stable Diffusion, GPT-4o-mini, Qwen2-VL, CLIP, and Claude.
0
stars
2
commits
HTML
primary language
Sep 6, 2026
updated
Multi-Agent System for Automated Advertisement Poster Generation
Posttiva is an AI-driven advertising assistant that turns a furniture product image and a small set of user preferences into a complete advertisement poster. The system coordinates specialized Image, Text, and Layout agents to preserve the real product, generate a context-aware background, write marketing copy, and compose the final poster.
Academic project: Bachelor of Artificial Intelligence Sciences, College of Computer and Information Sciences, Princess Nourah bint Abdulrahman University (PNU), Riyadh, 2026.
The pipeline is organized into three cooperating agents:
The final system was evaluated on 50 furniture products:
| Metric | Result |
|---|---|
| End-to-end completion | 100% (50/50) |
| SAM-HQ mean IoU | 86.30% |
| Background quality acceptance | 100% |
| Background CLIP score mean | 0.8020 |
| Text Agent acceptance | 100% |
| Layout quality acceptance | 72% |
| Mean end-to-end generation time | 87.02 s |
AI / ML: Python, PyTorch, Hugging Face Transformers, Diffusers, SAM-HQ, Stable Diffusion 2 Inpainting, GPT-4o-mini, Claude, Qwen2-VL, CLIP, OpenCV, scikit-learn
Backend: FastAPI, Express.js, PostgreSQL
Frontend: HTML, CSS, JavaScript
.
├── Posttiva/ # Frontend SPA
│ ├── index.html
│ ├── app.js
│ ├── api.js
│ └── config.js
├── Posttiva_Backend/ # FastAPI + AI multi-agent pipeline
│ ├── agents/
│ │ ├── image_agent.py
│ │ ├── text_agent.py
│ │ └── layout_agent.py
│ ├── models/loader.py
│ ├── main.py
│ └── requirements.txt
├── db-server/ # Express/PostgreSQL auth + project persistence
│ ├── server.js
│ ├── db.js
│ ├── schema.sql
│ └── package.json
└── assets/ # README visuals
The first AI run downloads large pretrained model weights, including the SAM-HQ checkpoint and Qwen/Stable Diffusion resources.
git clone <your-repository-url>
cd posttiva
cd Posttiva_Backend
python -m venv .venv
Activate the environment, then install dependencies:
pip install -r requirements.txt
Copy the environment template:
cp .env.example .env
Add your API keys to .env, then start FastAPI:
uvicorn main:app --host 0.0.0.0 --port 8000
Health check: http://localhost:8000/health
Create a PostgreSQL database named posttiva, then apply the included schema:
psql -d posttiva -f db-server/schema.sql
Install Node dependencies and create the environment file:
cd db-server
npm install
cp .env.example .env
node server.js
The database API runs at http://localhost:3001 by default.
In another terminal:
cd Posttiva
python -m http.server 8080
Open http://localhost:8080.
The checked-in config.js points to the local AI backend (:8000) and database backend (:3001). For deployment, replace those values with your hosted endpoints.
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /upload | Upload product image and initialize SAM |
| POST | /preview | Generate live SAM selection preview |
| POST | /save_mask | Confirm and save selected product mask |
| POST | /run_text | Start Text Agent job |
| POST | /run_image | Start Image Agent job |
| POST | /run_layout | Start Layout Agent job |
| GET | /job/{job_id} | Poll agent job status |
| GET | /job/{job_id}/result | Fetch completed job result |
| GET | /health | Backend health check |
Provides registration/login, password reset, profile updates, project save/update/delete, feedback, and logout endpoints under /api/....
.env files, and node_modules are intentionally excluded from Git.Developed as a graduation project by:
Supervised by Prof. Norah Alghamdi.
This repository presents the implementation of a university graduation project. Pretrained models and external APIs remain subject to their respective licenses and terms. No separate open-source license is granted by this repository unless the project team adds one explicitly.
2 commits
HTML
41.5%
JavaScript
24.6%
Python
24.0%
CSS
9.9%
Multi-agent AI system for automated advertisement poster generation using SAM-HQ, Stable Diffusion, GPT-4o-mini, Qwen2-VL, CLIP, and Claude.
0
stars
2
commits
HTML
primary language
Sep 6, 2026
updated
Multi-Agent System for Automated Advertisement Poster Generation
Posttiva is an AI-driven advertising assistant that turns a furniture product image and a small set of user preferences into a complete advertisement poster. The system coordinates specialized Image, Text, and Layout agents to preserve the real product, generate a context-aware background, write marketing copy, and compose the final poster.
Academic project: Bachelor of Artificial Intelligence Sciences, College of Computer and Information Sciences, Princess Nourah bint Abdulrahman University (PNU), Riyadh, 2026.
The pipeline is organized into three cooperating agents:
The final system was evaluated on 50 furniture products:
| Metric | Result |
|---|---|
| End-to-end completion | 100% (50/50) |
| SAM-HQ mean IoU | 86.30% |
| Background quality acceptance | 100% |
| Background CLIP score mean | 0.8020 |
| Text Agent acceptance | 100% |
| Layout quality acceptance | 72% |
| Mean end-to-end generation time | 87.02 s |
AI / ML: Python, PyTorch, Hugging Face Transformers, Diffusers, SAM-HQ, Stable Diffusion 2 Inpainting, GPT-4o-mini, Claude, Qwen2-VL, CLIP, OpenCV, scikit-learn
Backend: FastAPI, Express.js, PostgreSQL
Frontend: HTML, CSS, JavaScript
.
├── Posttiva/ # Frontend SPA
│ ├── index.html
│ ├── app.js
│ ├── api.js
│ └── config.js
├── Posttiva_Backend/ # FastAPI + AI multi-agent pipeline
│ ├── agents/
│ │ ├── image_agent.py
│ │ ├── text_agent.py
│ │ └── layout_agent.py
│ ├── models/loader.py
│ ├── main.py
│ └── requirements.txt
├── db-server/ # Express/PostgreSQL auth + project persistence
│ ├── server.js
│ ├── db.js
│ ├── schema.sql
│ └── package.json
└── assets/ # README visuals
The first AI run downloads large pretrained model weights, including the SAM-HQ checkpoint and Qwen/Stable Diffusion resources.
git clone <your-repository-url>
cd posttiva
cd Posttiva_Backend
python -m venv .venv
Activate the environment, then install dependencies:
pip install -r requirements.txt
Copy the environment template:
cp .env.example .env
Add your API keys to .env, then start FastAPI:
uvicorn main:app --host 0.0.0.0 --port 8000
Health check: http://localhost:8000/health
Create a PostgreSQL database named posttiva, then apply the included schema:
psql -d posttiva -f db-server/schema.sql
Install Node dependencies and create the environment file:
cd db-server
npm install
cp .env.example .env
node server.js
The database API runs at http://localhost:3001 by default.
In another terminal:
cd Posttiva
python -m http.server 8080
Open http://localhost:8080.
The checked-in config.js points to the local AI backend (:8000) and database backend (:3001). For deployment, replace those values with your hosted endpoints.
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /upload | Upload product image and initialize SAM |
| POST | /preview | Generate live SAM selection preview |
| POST | /save_mask | Confirm and save selected product mask |
| POST | /run_text | Start Text Agent job |
| POST | /run_image | Start Image Agent job |
| POST | /run_layout | Start Layout Agent job |
| GET | /job/{job_id} | Poll agent job status |
| GET | /job/{job_id}/result | Fetch completed job result |
| GET | /health | Backend health check |
Provides registration/login, password reset, profile updates, project save/update/delete, feedback, and logout endpoints under /api/....
.env files, and node_modules are intentionally excluded from Git.Developed as a graduation project by:
Supervised by Prof. Norah Alghamdi.
This repository presents the implementation of a university graduation project. Pretrained models and external APIs remain subject to their respective licenses and terms. No separate open-source license is granted by this repository unless the project team adds one explicitly.
2 commits
HTML
41.5%
JavaScript
24.6%
Python
24.0%
CSS
9.9%