Files
novafarma/scripts/test_character_consistency.py
David Kotnik efe3280df5 Vertex AI setup COMPLETE + character consistency tests
VERTEX AI SETUP SUCCESS (01.01.2026 21:00):
 gcloud CLI installed (v550.0.0)
 Authentication configured (ADC)
 Vertex AI API enabled
 Test generation successful (2 skull PNG)
 Credits confirmed: €1,121.80 available

CHARACTER TESTS:
⚠️ edit_image blocked by safety filters (face generation)
⚠️ seed parameter blocked by watermark
📝 Character animations need alternative approach

NEW FILES:
 reference_images/kai_master_stylea.png - Kai cartoon reference
 reference_images/kai_master_styleb.png - Kai noir reference
 scripts/test_character_consistency.py - Image edit test
 scripts/test_character_seed.py - Seed-based test

TEST OUTPUTS:
 test_vertex_output.png (Style A skull - 2.4MB)
 test_vertex_output_styleb.png (Style B skull)

PRODUCTION PLAN:
📊 Complete game: ~3,121-12,400 PNG
💰 Cost: €56-€223 (fully covered by credits!)
⏱️ Time: 8-34 hours for full generation
🎯 Ready for bulk asset generation

NEXT STEPS:
1. Decide generation scope (unique vs full production)
2. Run bulk generation script
3. Background removal post-processing
4. Git commit batches during generation

STATUS: Infrastructure ready, awaiting generation start 🚀
2026-01-01 21:06:17 +01:00

69 lines
2.6 KiB
Python

#!/usr/bin/env python3
"""
Test Character Consistency - Generate Kai walking animation frames
"""
import vertexai
from vertexai.preview.vision_models import ImageGenerationModel, Image
from pathlib import Path
# Initialize
vertexai.init(project="gen-lang-client-0428644398", location="us-central1")
# Load Kai reference (Style A - Cartoon)
kai_reference_path = Path("reference_images/kai_master_stylea.png")
kai_reference = Image.load_from_file(str(kai_reference_path))
print("="*60)
print("🎮 KAI CHARACTER CONSISTENCY TEST")
print("="*60)
print(f"📸 Reference: {kai_reference_path}")
print()
# Animation frames to generate
frames = [
{
"name": "kai_walk_frame1",
"prompt": "Same character Kai exactly as shown, walking animation, left leg forward step, right arm forward. Maintain exact same face, green hair, backpack, blue jeans, and brown boots. Cartoon vector style with bold outlines. Solid bright green background (#00FF00)."
},
{
"name": "kai_walk_frame2",
"prompt": "Same character Kai exactly as shown, walking animation, standing upright neutral pose, both feet together. Maintain exact same face, green hair, backpack, blue jeans, and brown boots. Cartoon vector style with bold outlines. Solid bright green background (#00FF00)."
},
{
"name": "kai_walk_frame3",
"prompt": "Same character Kai exactly as shown, walking animation, right leg forward step, left arm forward. Maintain exact same face, green hair, backpack, blue jeans, and brown boots. Cartoon vector style with bold outlines. Solid bright green background (#00FF00)."
}
]
model = ImageGenerationModel.from_pretrained("imagegeneration@006")
# Generate frames
for i, frame in enumerate(frames, 1):
print(f"\n🎨 Generating Frame {i}/3: {frame['name']}")
print(f"📝 Prompt: {frame['prompt'][:80]}...")
try:
# Use edit_image with reference for consistency
response = model.edit_image(
base_image=kai_reference,
prompt=frame['prompt'],
edit_mode="inpainting-insert",
negative_prompt="different character, different face, different hair color, different clothing, different proportions, watermark, text"
)
output_path = Path(f"test_character/{frame['name']}.png")
output_path.parent.mkdir(exist_ok=True)
response.images[0].save(location=str(output_path))
print(f"✅ Saved: {output_path}")
except Exception as e:
print(f"❌ Error: {e}")
print("\n" + "="*60)
print("✅ TEST COMPLETE!")
print("📁 Check: test_character/ folder")
print("="*60)