Files
novafarma/VERTEX_AI_SETUP_GUIDE.md
David Kotnik 5e23cbece0 🚀 Complete biome infrastructure + Vertex AI setup prep
TODAY'S ACCOMPLISHMENTS (01.01.2026):

DINO VALLEY GENERATION:
 Terrain: 16/16 PNG (100% complete)
 Vegetation: 20/20 PNG (100% complete)
🟨 Props: 2/40 PNG (5% started)
📊 Total: 69/212 PNG (33% Dino Valley complete)

NEW DOCUMENTATION:
 ALL_BIOMES_COMPLETE_BREAKDOWN.md - Complete 21-biome manifest (3,121 PNG total)
 GEMINI_WEB_UI_BIOME_PROMPTS.md - Ready-to-use generation prompts
 VERTEX_AI_SETUP_GUIDE.md - Step-by-step Vertex AI Imagen setup
 SESSION_DNEVNIK_01_01_2026.md - Complete session diary

NEW AUTOMATION SCRIPTS:
 scripts/generate_all_biomes_complete.py - Intelligent batch generator
 scripts/test_vertex_ai_simple.py - Vertex AI test script
 scripts/test_imagen.py - Imagen API test
 scripts/test_minimal.py - Minimal API test

INFRASTRUCTURE:
 All 21 biome directories with 10 categories each (210 folders)
 Dual art style system (Style A + Style B) fully operational
 Green chroma key background standard (#00FF00)

COMMITS TODAY: 5 (45 files modified/created)
IMAGES GENERATED: 38 PNG (33 new + 5 earlier)
TIME SPENT: ~7 hours
RATE LIMITING: Major bottleneck identified - Vertex AI is solution

NEXT STEPS:
1. Complete Vertex AI setup (gcloud auth)
2. Test image generation via Vertex API
3. Run bulk generation for remaining 3,052 PNG
4. Background removal batch processing
5. Complete all 21 biomes

STATUS: Production infrastructure ready, awaiting Vertex AI activation!
2026-01-01 19:56:09 +01:00

132 lines
2.7 KiB
Markdown

# 🚀 VERTEX AI SETUP - COMPLETE GUIDE
## **OPTION 1: Application Default Credentials (Easiest)**
### Step 1: Install Google Cloud CLI
```bash
# Check if installed
gcloud --version
# If not, install:
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
```
### Step 2: Login & Set Project
```bash
# Login to Google Cloud
gcloud auth application-default login
# Set your project
gcloud config set project gen-lang-client-0428644398
# Verify
gcloud config get-value project
```
### Step 3: Enable Vertex AI API
```bash
# Enable the API
gcloud services enable aiplatform.googleapis.com
# Verify it's enabled
gcloud services list --enabled | grep aiplatform
```
### Step 4: Test the Script
```bash
# Run test
python3 scripts/test_vertex_ai_simple.py
```
**If successful:** You'll see a `test_vertex_output.png` file generated! ✅
---
## **OPTION 2: Service Account (If Option 1 fails)**
### Step 1: Create Service Account
```bash
# Create service account
gcloud iam service-accounts create vertex-ai-image-gen \
--description="For Vertex AI Imagen image generation" \
--display-name="Vertex AI Image Generator"
```
### Step 2: Grant Permissions
```bash
# Grant Vertex AI User role
gcloud projects add-iam-policy-binding gen-lang-client-0428644398 \
--member="serviceAccount:vertex-ai-image-gen@gen-lang-client-0428644398.iam.gserviceaccount.com" \
--role="roles/aiplatform.user"
```
### Step 3: Download JSON Key
```bash
# Create and download key
gcloud iam service-accounts keys create ~/vertex-ai-key.json \
--iam-account=vertex-ai-image-gen@gen-lang-client-0428644398.iam.gserviceaccount.com
# Verify
ls -la ~/vertex-ai-key.json
```
### Step 4: Set Environment Variable
```bash
# Add to ~/.zshrc
echo 'export GOOGLE_APPLICATION_CREDENTIALS="$HOME/vertex-ai-key.json"' >> ~/.zshrc
# Reload
source ~/.zshrc
# Verify
echo $GOOGLE_APPLICATION_CREDENTIALS
```
### Step 5: Test
```bash
python3 scripts/test_vertex_ai_simple.py
```
---
## **TROUBLESHOOTING:**
### Error: "Permission denied"
```bash
# Grant additional permissions
gcloud projects add-iam-policy-binding gen-lang-client-0428644398 \
--member="serviceAccount:vertex-ai-image-gen@gen-lang-client-0428644398.iam.gserviceaccount.com" \
--role="roles/aiplatform.admin"
```
### Error: "API not enabled"
```bash
gcloud services enable aiplatform.googleapis.com
```
### Error: "Quota exceeded"
Check: https://console.cloud.google.com/apis/api/aiplatform.googleapis.com/quotas
---
## **NEXT STEPS AFTER SUCCESS:**
1. ✅ Test script works
2. 🔄 Integrate into `generate_all_biomes_complete.py`
3. 🚀 Run bulk generation (3000+ images!)
4. 🎉 Complete all biomes!
---
**START HERE:** Try Option 1 first (Application Default Credentials) - it's simpler!