How googlecloudplatform/vertex-ai-creative-studio works
Project Type and Purpose
• This is a full-stack, Python-based web application built on Mesop.
• It showcases Google Cloud Vertex AI generative APIs (Imagen for text-to-image, Gemini for prompts and multimodal critique).
• It's delivered as a monolithic Mesop app (root “main.py”) plus a collection of standalone “experiments” apps (Arena, Babel, Veo, etc.) in the same repo.
File Structure
Top-level:
• main.py – entry point for the Mesop web server
• config/ – application configuration (GCP project, storage bucket, credentials)
• models/ – Python modules calling Vertex AI models
• prompts/ – prompt templates, critic logic
• experiments/ – multiple subfolders; each experiment is a self-contained app or service
• requirements.txt, Procfile, env_template – deployment and environment setup
experiments/arena (example):
• components/, pages/, state/ – Mesop UI layers
• config/ – Firebase/Spanner configs
• scripts/ – data ingestion to Firestore, GCS bulk upload
• models/ – model-wrapping Python code
README for Insights
• The root README confirms:
– Uses Mesop for UI
– Requires PROJECT_ID + IMAGE_CREATION_BUCKET (GCS)
– Deployable on Cloud Run (Cloud Run service account with AI and Storage roles)
• Experiments are stand-alone demos awaiting integration into the main app.
Main Components
A. Mesop Web Application (Monolith)
– UI Layer (Pages, Components)
– Business Logic Layer (models/, prompts/)
– Config Layer (config/)
B. External Services
– Vertex AI APIs (Imagen, Gemini)
– Google Cloud Storage (bucket for generated media)
– (Optionally) Firestore or Spanner if used by experiments
C. Deployment Targets
– Local (Mesop CLI)
– Cloud Run (Container)
Relationships & Data Flows
• User → HTTP(S) → Mesop server (main.py)
• Mesop UI triggers business logic
• Business logic calls Vertex AI REST/gRPC endpoints
• AI responses return to Mesop, rendered in browser
• For images: Mesop uploads to GCS → GCS returns URL → displayed in UI
• (Experiments only) Ingestion scripts load metadata into Firestore/Spanner → Data shown in experiment UI
Architectural Patterns & Principles
• Monolithic UI + backend in one Python process
• Layered separation: UI Components → Business Logic (model wrappers) → External API/Storage
• Modular “experiments” folder: each demo is a self-contained micro-app
• Twelve-factor app conventions (env vars, Procfile, config directory)
Technologies & Frameworks to Highlight
• Mesop (Python UI framework)
• Python 3 modules (models/, prompts/, utils/)
• Vertex AI generative APIs (Imagen, Gemini)
• Google Cloud Storage
• (Experiments) Firestore/Spanner, Dockerfiles, Go services (Babel, MCP-GenMedia), Jupyter notebooks