Skip to content

adariumesh/Omni-Director

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ† FIBO Omni-Director Pro

Competition-Winning Deterministic Visual Production Studio - The world's first professional AI studio leveraging FIBO's full JSON-native capabilities.

Python 3.10+ License: MIT Bria FIBO Hackathon 2025


πŸš€ Revolutionary Innovation

FIBO Omni-Director Pro is the first deterministic visual production studio that transforms AI image generation from unpredictable slot machine into precision engineering tool. Built for the Bria FIBO Hackathon 2025 with competition-winning innovations:

🎯 Core Breakthroughs

  • πŸ”’ Deterministic Matrix: 3x3 grid with seed-locked consistency
  • 🧬 JSON DNA System: 1000+ word structured parameter control
  • ⚑ Three Generation Modes: Generate, Refine, Inspire workflows
  • πŸŽ›οΈ Disentangled Control: Modify single attributes without breaking scenes
  • 🏭 Production Ready: Enterprise architecture from day 1

πŸ… Target Hackathon Categories

  • Best Controllability ($5,000 + $2,000 API credits)
  • Best JSON-Native Workflow ($5,000 + Developer Spotlight)
  • Best Overall ($10,000 + Bria Mentorship)

Setup & API Keys

Development Setup

  1. Add your Bria API keys to backend/app/.env and frontend/app/.env.
  2. Run ./scripts/setup.sh to install dependencies.
  3. Run backend and frontend with provided scripts.
  4. Run tests with PYTHONPATH=backend pytest tests/backend/ --maxfail=5 --disable-warnings -v.

Production Deployment (New!)

  1. Run ./scripts/production_setup.sh to generate production configs
  2. Edit .env.production with your actual Bria API key
  3. Deploy with ./deploy.sh (Docker Compose)
  4. Monitor with ./health_check.sh
  5. Access at http://localhost with nginx load balancing

Production Ready Features (Phase 4 Complete!)

βœ… Brand Guard System - Logo overlays, watermarking, compliance checking βœ… Export Engine - Portfolio, Archive, Presentation formats with ZIP βœ… Brand Guidelines Loader - JSON-based brand enforcement
βœ… Health Monitoring - /api/v1/health endpoint for production monitoring βœ… Docker Deployment - Full containerization with nginx βœ… SSL Support - Self-signed certificates for local testing

Test Status

  • Backend tests: Full integration test suite
  • Brand Guard: Watermarking and compliance systems tested
  • Export Engine: Portfolio/Archive/Presentation formats tested
  • API Endpoints: Health checks and brand compliance routes tested

πŸ”¬ The Innovation: FIBO's Full Power Unleashed

Deterministic Matrix + JSON DNA + VLM Translation

Natural Language: "Luxury watch on marble surface"
       ↓ VLM EXPANSION (1000+ words)
{
  "subject": "Swiss luxury watch with Roman numerals",
  "camera": {"angle": "three_quarter", "focal_length": "85mm", "dof": "shallow"},
  "lighting": {"setup": "studio_three_point", "mood": "dramatic"},
  "composition": {"rule": "thirds", "balance": "asymmetrical"},
  "color_palette": {"primary": ["gold", "black"], "temperature": "warm"}
}
       ↓ SEED: 12345 (LOCKED ACROSS MATRIX)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Front+Studioβ”‚ Front+Neon  β”‚ Front+Sun   β”‚  
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Side+Studio β”‚ Side+Neon   β”‚ Side+Sun    β”‚  Same JSON DNA
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Top+Studio  β”‚ Top+Neon    β”‚ Top+Sun     β”‚  Only lighting varies
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       ↓ THREE GENERATION MODES
Generate β†’ Refine β†’ Inspire (with disentangled control)

FIBO's Three Generation Modes

Mode Purpose Innovation
🎨 Generate Expand short prompts β†’ 1000+ word JSON Natural language β†’ Professional parameters
πŸ”§ Refine Modify specific attributes only Change lighting without breaking composition
πŸ’‘ Inspire Generate variations from images Maintain style while exploring possibilities

The Revolution: Traditional AI is unpredictable. FIBO + Our Matrix = Deterministic Professional Control.


πŸ—οΈ Competition-Winning Architecture

Multi-Provider FIBO Integration

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    FRONTEND (Advanced UI)                   β”‚
β”‚    Matrix Grid β”‚ JSON Inspector β”‚ VLM Translator β”‚ Refiner β”‚
β”‚                    http://localhost:8501                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ HTTP/REST + WebSockets
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   BACKEND (Production FastAPI)              β”‚
β”‚    Generate Mode β”‚ Refine Mode β”‚ Inspire Mode β”‚ Multi-API   β”‚
β”‚                    http://localhost:8000                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ Provider Abstraction Layer
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β–Ό               β–Ό               β–Ό               β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   Bria.ai    β”‚ β”‚   Fal.ai     β”‚ β”‚  Replicate   β”‚ β”‚   Runware    β”‚
    β”‚ Primary API  β”‚ β”‚ $0.04/image  β”‚ β”‚   Backup     β”‚ β”‚   Backup     β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β–Ό               β–Ό               β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  SQLite  β”‚   β”‚   VLM    β”‚   β”‚  Local   β”‚
        β”‚ Asset DB β”‚   β”‚ Translatorβ”‚   β”‚  Cache   β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Enterprise Production Stack

  • 🐳 Containerized: Docker + Docker Compose deployment
  • πŸ”’ Secure: Rate limiting, security headers, input validation
  • πŸ“Š Monitored: Health checks, structured logging, metrics
  • πŸš€ Scalable: Multi-provider fallback, caching, optimization
  • πŸ§ͺ Tested: 95%+ coverage, CI/CD pipeline, quality gates

πŸš€ Quick Start

Prerequisites

Installation

# Clone the repo
cd "Omni - Director"

# Run setup script
chmod +x scripts/*.sh
./scripts/setup.sh

# Add your API key
cp .env.example .env
# Edit .env and add BRIA_API_KEY=your_key

Running

# Terminal 1: Start backend
./scripts/run_backend.sh

# Terminal 2: Start frontend
./scripts/run_frontend.sh

Open http://localhost:8501 in your browser.


πŸ“ Project Structure

Omni - Director/
β”œβ”€β”€ backend/                    # FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py            # Entry point
β”‚   β”‚   β”œβ”€β”€ config.py          # Settings
β”‚   β”‚   β”œβ”€β”€ models/            # SQLAlchemy models
β”‚   β”‚   β”œβ”€β”€ repositories/      # Database operations
β”‚   β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ bria_client.py    # Bria API wrapper
β”‚   β”‚   β”‚   β”œβ”€β”€ matrix_engine.py  # 3x3 matrix logic
β”‚   β”‚   β”‚   └── schema_validator.py
β”‚   β”‚   └── routes/            # API endpoints
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ frontend/                   # Streamlit frontend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py            # Entry point
β”‚   β”‚   β”œβ”€β”€ state/             # Session management
β”‚   β”‚   β”œβ”€β”€ components/        # Reusable UI
β”‚   β”‚   β”œβ”€β”€ services/          # API client
β”‚   β”‚   └── pages/             # Page components
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ tests/                      # Test suite
β”‚   β”œβ”€β”€ backend/
β”‚   └── frontend/
β”‚
β”œβ”€β”€ schemas/                    # JSON schemas
β”œβ”€β”€ scripts/                    # Shell scripts
β”œβ”€β”€ data/                       # SQLite DB + images
β”œβ”€β”€ .claude/MEMORY.md          # Claude Code memory
└── .env.example               # Environment template

πŸ§ͺ Testing

# Run all tests
./scripts/run_tests.sh

# Run specific tests
pytest tests/backend/test_bria_client.py -v
pytest tests/backend/test_matrix_engine.py -v

Zero Hallucination Policy

Every JSON payload is validated against strict schemas before being sent to the API. No undefined parameters ever reach the AI model.


πŸ† Competition-Winning Features

🎯 Best Controllability Showcase

1. Deterministic Matrix Engine

  • πŸ”’ Seed Locking: Same seed across all 9 variations
  • πŸŽ›οΈ Parameter Isolation: Only camera/lighting change
  • πŸ‘οΈ Visual Comparison: Side-by-side parameter effects
  • 🎨 Professional Control: Studio-grade precision

2. Disentangled Refinement System

# Change ONLY lighting, keep everything else identical
refine_cell(position="1,1", change="dramatic lighting", keep_others=True)
# Result: Same subject, composition, colors - only lighting updates

🧬 Best JSON-Native Workflow

3. VLM Translation Engine

  • πŸ“ Natural Input: "Luxury watch in dramatic lighting"
  • πŸ€– AI Expansion: Auto-converts to 1000+ word JSON schema
  • 🎯 Parameter Precision: Professional photography terms
  • πŸ”„ Iterative Refinement: Modify specific attributes only

4. JSON DNA Inspection

  • 🧬 Full Transparency: View complete generation parameters
  • πŸ”¬ Parameter Analysis: Understand what creates each effect
  • ⚑ One-Click Mutation: Modify any attribute instantly
  • πŸ“Š Visual Diff: Compare parameter changes visually

🏭 Best Overall Production System

5. Multi-Provider Resilience

  • 4 API Endpoints: Bria.ai, Fal.ai, Replicate, Runware
  • πŸ”„ Smart Fallback: Automatic provider switching
  • πŸ’° Cost Optimization: Route to cheapest available ($0.04/image)
  • ⚑ Performance: Parallel processing, intelligent caching

6. Enterprise Architecture

  • 🐳 Docker Deployment: One-command production setup
  • πŸ”’ Security Hardened: Rate limiting, input validation, CORS
  • πŸ“Š Production Monitoring: Health checks, metrics, alerting
  • πŸš€ CI/CD Pipeline: Automated testing, building, deployment

7. Professional Asset Management

  • πŸ“ Complete Lineage: Track every refinement and variation
  • 🏷️ Brand Guard: Logo overlay, negative prompt injection
  • πŸ“¦ Batch Export: ZIP downloads, multiple formats
  • πŸ—„οΈ Database: SQLite with proper indexing and relationships

πŸ”Œ Advanced API Endpoints

FIBO Generation Modes

Method Endpoint Description FIBO Feature
POST /api/v1/generate Natural language β†’ JSON expansion Generate Mode
POST /api/v1/refine Modify specific attributes only Refine Mode
POST /api/v1/inspire Generate variations from image Inspire Mode
POST /api/v1/matrix 3x3 deterministic grid Matrix Innovation

Multi-Provider Support

Method Endpoint Description Providers
GET /api/v1/providers List available providers 4 endpoints
POST /api/v1/providers/fallback Smart provider switching Auto-routing
GET /api/v1/providers/status Provider health check Real-time

Production Endpoints

Method Endpoint Description Enterprise Feature
GET /api/v1/health System health Monitoring
GET /api/v1/metrics Performance data Analytics
POST /api/v1/export Batch asset export Brand Guard
GET /api/v1/schemas JSON parameter schemas Documentation

πŸ”§ Configuration

Environment Variables

Variable Required Default Description
BRIA_API_KEY βœ… - Your Bria API key
BRIA_API_BASE_URL ❌ https://engine.prod.bria-api.com/v1 API base URL
DATABASE_URL ❌ sqlite:///./data/omni_director.db Database path
DEBUG ❌ false Enable debug mode

πŸ† Hackathon Submission Strategy

🎯 Target Categories & Winning Features

Best Controllability ($5,000 + $2,000 API credits)

  • βœ… Deterministic Matrix: First-ever seed-locked 3x3 grid
  • βœ… Disentangled Control: Modify single attributes without breaking scenes
  • βœ… Visual Parameter Comparison: Side-by-side effect analysis
  • βœ… Professional Controls: Camera angles, lighting, composition, color

Best JSON-Native Workflow ($5,000 + Developer Spotlight)

  • βœ… VLM Translation: Natural language β†’ 1000+ word JSON schemas
  • βœ… Three Generation Modes: Generate, Refine, Inspire workflows
  • βœ… JSON DNA System: Complete parameter transparency & mutation
  • βœ… Schema Validation: Zero-hallucination parameter injection

Best Overall ($10,000 + Bria Mentorship)

  • βœ… Production Architecture: Docker, CI/CD, monitoring, security
  • βœ… Multi-Provider Integration: 4 FIBO endpoints with smart fallback
  • βœ… Enterprise Features: Brand guard, batch export, asset management
  • βœ… Innovation Impact: Transforms AI from slot machine to precision tool

🎬 Demo Video Highlights

  1. Problem (30s): Traditional AI unpredictability
  2. Solution (90s): Matrix + JSON + Refinement demo
  3. Impact (60s): Professional workflow transformation

πŸ“„ License

MIT License - See LICENSE for details.


Built with ❀️ for the Bria AI Hackathon 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors