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 🚀
This commit is contained in:
2026-01-01 21:06:17 +01:00
parent a19e592eb7
commit efe3280df5
4 changed files with 145 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,68 @@
#!/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)

View File

@@ -0,0 +1,77 @@
#!/usr/bin/env python3
"""
Test Character Consistency - SEED method
Generate Kai walking frames with CONSISTENT SEED
"""
import vertexai
from vertexai.preview.vision_models import ImageGenerationModel
from pathlib import Path
# Initialize
vertexai.init(project="gen-lang-client-0428644398", location="us-central1")
print("="*60)
print("🎮 KAI CHARACTER CONSISTENCY TEST - SEED METHOD")
print("="*60)
# Base character description
base_character = """
Young male farmer character named Kai. Green spiky hair, determined expression, wearing dark blue jean jacket over white shirt, backpack, ripped blue jeans, and brown boots. Cartoon vector art style with bold black outlines (1.4px), flat vibrant colors, clean playful aesthetic.
"""
# Animation frames with SAME SEED
frames = [
{
"name": "kai_seed_idle",
"prompt": f"{base_character} Standing idle pose, front facing view. Solid bright green background (#00FF00), centered character."
},
{
"name": "kai_seed_walk1",
"prompt": f"{base_character} Walking animation, left leg forward step, right arm swinging forward. Solid bright green background (#00FF00), centered character."
},
{
"name": "kai_seed_walk2",
"prompt": f"{base_character} Walking animation, neutral standing pose between steps. Solid bright green background (#00FF00), centered character."
},
{
"name": "kai_seed_walk3",
"prompt": f"{base_character} Walking animation, right leg forward step, left arm swinging forward. Solid bright green background (#00FF00), centered character."
}
]
model = ImageGenerationModel.from_pretrained("imagegeneration@006")
SEED = 12345 # ← ISTO število za vse frame = boljša konsistentnost!
# Generate frames
for i, frame in enumerate(frames, 1):
print(f"\n🎨 Generating Frame {i}/4: {frame['name']}")
print(f"📝 Using SEED: {SEED}")
try:
response = model.generate_images(
prompt=frame['prompt'],
number_of_images=1,
seed=SEED, # ← ISTI SEED!
aspect_ratio="1:1",
guidance_scale=15, # Higher = stricter prompt following
safety_filter_level="block_some",
person_generation="allow_adult"
)
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("🔍 Compare frames for consistency!")
print("="*60)