Skip to content

N-45div/PromptVision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โœจ PromptVision

Vision from Prompts

Transform creative briefs into complete visual asset libraries with AI-powered shot planning and FIBO's JSON-native image generation

Next.js FastAPI Bria FIBO License


๐ŸŽฏ What is PromptVision?

PromptVision is a professional visual asset pipeline that turns a simple creative brief into a complete library of brand-consistent images. Powered by a multi-agent AI system and Bria's FIBO model, it automates the entire creative workflow from concept to final assets.

๐Ÿ“ Creative Brief  โ†’  ๐Ÿค– AI Agents  โ†’  ๐ŸŽจ FIBO Generation  โ†’  ๐Ÿ“ฆ Asset Library

The Problem It Solves

Creating visual assets for brands, products, or campaigns typically requires:

  • Hours of back-and-forth with designers
  • Inconsistent results across different shots
  • Expensive reshoots when parameters need tweaking
  • No reproducibility or version control

PromptVision solves this by combining AI planning with FIBO's deterministic, JSON-native generation.


โšก Features

๐Ÿค– Multi-Agent AI Pipeline

Four specialized AI agents work together to transform your brief:

Agent Role What It Does
๐ŸŽจ Brand Analyst Strategic Analysis Extracts brand essence, target audience, visual identity
๐ŸŽฌ Visual Strategist Creative Direction Defines color palettes, lighting styles, mood boards
๐Ÿ“ธ Shot Planner Technical Planning Creates 6-12 shots with camera specs, composition, angles
โœ… Quality Reviewer Consistency Check Validates coherence, fills gaps, ensures brand alignment

๐ŸŽ›๏ธ JSON-Native Control

Every image is generated with precise, reproducible parameters:

{
  "scene": {
    "description": "Premium coffee product on marble surface",
    "environment": "Minimalist studio with soft shadows"
  },
  "camera": {
    "angle": "eye_level",
    "shot_type": "medium_shot",
    "focal_length": "85mm"
  },
  "lighting": {
    "type": "soft_studio",
    "direction": "front_left",
    "intensity": "medium"
  },
  "color_palette": ["#8B4513", "#F5F5DC", "#2F4F4F"]
}

๐Ÿ”„ Advanced FIBO Features

๐ŸŽฒ Seed Variations

Generate 4-8 variations of any shot with controlled seeds for A/B testing and exploration.

๐ŸŒˆ HDR / 16-bit Output

Professional color depth with Display P3 and Adobe RGB color space support.

๐ŸŽจ Style Consistency

Set a reference shot and maintain visual coherence across your entire project.

๐Ÿ”ง Disentangled Refinement

Modify ONE attribute without affecting others - change lighting without changing composition.

๐Ÿ“ฆ Professional Export

  • ZIP Download - All assets organized with metadata
  • JSON Prompts - Full reproducibility for any shot
  • Seed Tracking - Recreate exact results anytime

๐Ÿ‘ฅ Real-time Collaboration

Powered by Liveblocks, collaborate with your team in real-time:

Feature Description
๐Ÿ–ฑ๏ธ Live Cursors See where teammates are working in real-time
๐Ÿ‘ค Presence Avatars Know who's online with color-coded avatars
๐Ÿ”” Activity Sync Shot updates broadcast to all collaborators
๐ŸŽจ Persistent Identity Your name and color persist across sessions

๐Ÿš€ Quick Start

Prerequisites

Requirement Version Purpose
Node.js 18+ Frontend runtime
Python 3.10+ Backend runtime
pnpm Latest Package manager
Bria API Key - FIBO image generation
OpenRouter API Key - Multi-agent LLM

Installation

# Clone the repository
git clone https://github.com/N-45div/PromptVision.git
cd PromptVision

# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# Backend Setup
# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env with your API keys:
#   BRIA_API_KEY=your_bria_api_key
#   OPENROUTER_API_KEY=your_openrouter_api_key

# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# Frontend Setup
# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
cd ../frontend
pnpm install

Running Locally

# Terminal 1 - Backend
cd backend && source venv/bin/activate
uvicorn main:app --reload --port 8000

# Terminal 2 - Frontend
cd frontend
pnpm dev

๐ŸŒ Open http://localhost:3000


โ˜๏ธ Deployment

Backend โ†’ Google Cloud Run

cd backend

# Option 1: One-command deploy
./deploy.sh YOUR_GCP_PROJECT_ID us-central1

# Option 2: Manual steps
gcloud builds submit --tag gcr.io/YOUR_PROJECT/promptvision-api
gcloud run deploy promptvision-api \
  --image gcr.io/YOUR_PROJECT/promptvision-api \
  --platform managed \
  --region us-central1 \
  --allow-unauthenticated

# Set environment variables
gcloud run services update promptvision-api \
  --set-env-vars "BRIA_API_KEY=xxx,OPENROUTER_API_KEY=xxx"

Frontend โ†’ Vercel

  1. Push to GitHub
  2. Import project at vercel.com/new
  3. Set root directory to frontend
  4. Add environment variable:
    NEXT_PUBLIC_API_URL=https://your-cloud-run-url.run.app
    NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY=pk_xxx
    
  5. Deploy! ๐Ÿš€

๐Ÿ—๏ธ Architecture

System Overview

flowchart TB
    subgraph Frontend["๐Ÿ–ฅ๏ธ Frontend (Next.js 16)"]
        LP[Landing Page]
        DB[Dashboard]
        PD[Project Detail]
        SC[Shot Cards]
        
        LP --> DB
        DB --> PD
        PD --> SC
    end
    
    subgraph Backend["โš™๏ธ Backend (FastAPI)"]
        API[REST API]
        
        subgraph Agents["๐Ÿค– Multi-Agent Pipeline"]
            BA[Brand Analyst]
            VS[Visual Strategist]
            SP[Shot Planner]
            QR[Quality Reviewer]
            
            BA --> VS --> SP --> QR
        end
        
        subgraph Services["๐Ÿ”ง Services"]
            FS[FIBO Service]
            PS[Project Service]
        end
        
        API --> Agents
        API --> Services
        Agents --> FS
    end
    
    subgraph External["โ˜๏ธ External APIs"]
        FIBO[Bria FIBO API]
        LLM[OpenRouter LLM]
    end
    
    Frontend <--> API
    FS <--> FIBO
    Agents <--> LLM
    
    style Frontend fill:#1a1a2e,stroke:#0ea5e9,color:#fff
    style Backend fill:#1a1a2e,stroke:#10b981,color:#fff
    style External fill:#1a1a2e,stroke:#f59e0b,color:#fff
    style Agents fill:#2d2d44,stroke:#8b5cf6,color:#fff
    style Services fill:#2d2d44,stroke:#06b6d4,color:#fff
Loading

Sequence Diagram - Project Creation Flow

sequenceDiagram
    autonumber
    participant U as ๐Ÿ‘ค User
    participant F as ๐Ÿ–ฅ๏ธ Frontend
    participant API as โš™๏ธ FastAPI
    participant MA as ๐Ÿค– Multi-Agent
    participant FIBO as ๐ŸŽจ FIBO API
    
    U->>F: Enter creative brief
    F->>API: POST /api/projects
    
    rect rgb(45, 45, 68)
        Note over MA: Multi-Agent Pipeline
        API->>MA: Process brief
        MA->>MA: 1๏ธโƒฃ Brand Analyst<br/>Extract brand essence
        MA->>MA: 2๏ธโƒฃ Visual Strategist<br/>Define visual style
        MA->>MA: 3๏ธโƒฃ Shot Planner<br/>Create shot list
        MA->>MA: 4๏ธโƒฃ Quality Reviewer<br/>Validate consistency
    end
    
    MA-->>API: Shot definitions + brand guidelines
    API-->>F: Project created
    F-->>U: Show project with shots
    
    U->>F: Click "Generate All"
    F->>API: POST /api/projects/{id}/generate
    
    loop For each shot
        rect rgb(40, 60, 60)
            API->>FIBO: Generate structured prompt
            FIBO-->>API: JSON prompt
            API->>FIBO: Generate image
            FIBO-->>API: Image URL + seed
        end
    end
    
    API-->>F: All shots generated
    F-->>U: Display generated images
Loading

Sequence Diagram - Shot Refinement Flow

sequenceDiagram
    autonumber
    participant U as ๐Ÿ‘ค User
    participant F as ๐Ÿ–ฅ๏ธ Frontend
    participant API as โš™๏ธ FastAPI
    participant FIBO as ๐ŸŽจ FIBO API
    
    U->>F: Click "Refine" on shot
    U->>F: Enter: "make lighting more dramatic"
    F->>API: POST /api/projects/{id}/shots/{shot_id}/refine
    
    rect rgb(45, 45, 68)
        Note over API,FIBO: Disentangled Refinement
        API->>FIBO: Refine structured prompt<br/>(only lighting changes)
        FIBO-->>API: Updated JSON prompt
        API->>FIBO: Generate with same seed
        FIBO-->>API: New image<br/>(composition preserved)
    end
    
    API-->>F: Refined shot
    F-->>U: Display updated image
    
    Note over U,FIBO: โœจ Only lighting changed<br/>Everything else preserved
Loading

Sequence Diagram - Advanced Features

sequenceDiagram
    autonumber
    participant U as ๐Ÿ‘ค User
    participant F as ๐Ÿ–ฅ๏ธ Frontend
    participant API as โš™๏ธ FastAPI
    participant FIBO as ๐ŸŽจ FIBO API
    
    alt Seed Variations
        U->>F: Click "Variations"
        F->>API: POST /shots/{id}/variations?num=4
        loop 4 times (parallel)
            API->>FIBO: Generate with seed+i
            FIBO-->>API: Variation image
        end
        API-->>F: 4 variations
        F-->>U: Display variation grid
    end
    
    alt HDR Generation
        U->>F: Click "HDR"
        F->>API: POST /shots/{id}/hdr?mode=professional
        API->>FIBO: Generate 16-bit Adobe RGB
        FIBO-->>API: HDR image + metadata
        API-->>F: HDR result
        F-->>U: Display with HDR badge
    end
    
    alt ControlNet
        U->>F: Upload control image
        F->>API: POST /shots/{id}/controlnet
        API->>FIBO: Generate with depth/canny guide
        FIBO-->>API: Guided image
        API-->>F: ControlNet result
        F-->>U: Display guided output
    end
    
    alt Style Reference
        U->>F: Click "Set as Style Ref"
        F->>API: POST /style-reference?shot_id=X
        API-->>F: Style locked
        Note over F: Future shots use<br/>this style + seed
    end
Loading

Tech Stack

Layer Technology Purpose
Frontend Next.js 16, React 19, TailwindCSS Modern UI with server components
State Zustand Lightweight state management
UI Components shadcn/ui, Lucide Icons Beautiful, accessible components
Real-time Liveblocks Live cursors & presence
Backend FastAPI, Python 3.10+ High-performance async API
AI Agents LangGraph, LangChain Multi-agent orchestration
LLM OpenRouter (Claude 3.5 Sonnet) Agent reasoning
Image Gen Bria FIBO API JSON-native generation
Storage File-based JSON Simple, portable persistence

๐Ÿ“– Usage

1๏ธโƒฃ Create a Project

Choose from professional templates or write your own brief:

"Create brand assets for EcoBean, a sustainable coffee company targeting eco-conscious millennials. The brand is warm, authentic, and modern with earthy tones. We need hero shots of the coffee product, lifestyle images, and social media content."

2๏ธโƒฃ Watch the AI Work

The multi-agent pipeline processes your brief with real-time visualization:

โœ“ Brand Analyst      โ†’ Extracted brand essence and target audience
โœ“ Visual Strategist  โ†’ Defined color palette and lighting style  
โœ“ Shot Planner       โ†’ Created 8 diverse shots with camera specs
โœ“ Quality Reviewer   โ†’ Validated consistency and filled gaps

3๏ธโƒฃ Generate & Refine

  • Generate All - Create all shots in parallel
  • Refine - "make the lighting more dramatic"
  • Regenerate - New seed, same parameters
  • Variations - Generate 4 alternatives
  • HDR - Professional 16-bit output
  • Style Ref - Lock in visual consistency

4๏ธโƒฃ Export

Download all assets as a ZIP with organized folders and metadata.


๐Ÿ“š API Reference

Projects

Method Endpoint Description
POST /api/projects Create project from brief
GET /api/projects List all projects
GET /api/projects/{id} Get project details
DELETE /api/projects/{id} Delete project
GET /api/projects/{id}/export Download ZIP

Shots

Method Endpoint Description
POST /api/projects/{id}/generate Generate all pending shots
POST /api/projects/{id}/shots/{shot_id}/refine Refine with instruction
POST /api/projects/{id}/shots/{shot_id}/regenerate Regenerate with new seed

Advanced Features

Method Endpoint Description
GET /api/projects/capabilities List available features
POST /api/projects/{id}/shots/{shot_id}/variations Generate seed variations
POST /api/projects/{id}/shots/{shot_id}/hdr Generate HDR version
POST /api/projects/{id}/shots/{shot_id}/controlnet Generate with ControlNet guidance
POST /api/projects/{id}/style-reference Set style reference
GET /api/projects/{id}/style-reference Get style reference

๐Ÿ“ Project Structure

PromptVision/
โ”œโ”€โ”€ ๐Ÿ“‚ backend/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ app/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ agent/           # Multi-agent pipeline
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ multi_agent.py  # LangGraph orchestration
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ models/          # Pydantic schemas
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ schemas.py      # Data models
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ routers/         # API endpoints
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ projects.py     # Project routes
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ services/        # Business logic
โ”‚   โ”‚       โ”œโ”€โ”€ fibo_service.py # FIBO API integration
โ”‚   โ”‚       โ””โ”€โ”€ project_service.py
โ”‚   โ”œโ”€โ”€ main.py                 # FastAPI app
โ”‚   โ””โ”€โ”€ requirements.txt
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ frontend/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ src/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ app/             # Next.js pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx        # Landing
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/      # Project list
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ projects/[id]/  # Project detail
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ components/      # React components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ shot-card.tsx   # Shot display
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ create-project-dialog.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ ui/          # shadcn components
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ lib/             # Utilities
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ api.ts          # API client
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ store/           # Zustand
โ”‚   โ”‚       โ””โ”€โ”€ project-store.ts
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ””โ”€โ”€ README.md

๐Ÿ”ฎ Roadmap

  • Multi-agent brief decomposition
  • JSON-native FIBO generation
  • Disentangled refinement
  • Seed variations
  • HDR/16-bit output
  • Style consistency
  • ZIP export
  • Professional templates
  • ControlNet integration (depth, canny, recolor, color grid)
  • Real-time collaboration (Liveblocks)
  • Figma/Canva export
  • Custom agent training

๐Ÿ“„ License

MIT License - see LICENSE for details.


Built with โค๏ธ using Bria FIBO

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors