From 9543b44fbaf644acf6c10ce71847a13593dfb5b7 Mon Sep 17 00:00:00 2001 From: David Kotnik Date: Mon, 29 Dec 2025 11:35:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=99=20Add=20overnight=20automation=20s?= =?UTF-8?q?cript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Autonomous generation of remaining 384 assets - 60s rate limiting between assets - Auto-commits every 20 assets - Estimated 6.4 hours runtime - Full documentation in OVERNIGHT_GENERATION.md Ready to run: nohup python3 scripts/generate_overnight.py > overnight_production.log 2>&1 & --- OVERNIGHT_GENERATION.md | 65 ++++++++++++++++++++ scripts/generate_overnight.py | 112 ++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 OVERNIGHT_GENERATION.md create mode 100755 scripts/generate_overnight.py diff --git a/OVERNIGHT_GENERATION.md b/OVERNIGHT_GENERATION.md new file mode 100644 index 000000000..8c7db1cb5 --- /dev/null +++ b/OVERNIGHT_GENERATION.md @@ -0,0 +1,65 @@ +# šŸŒ™ OVERNIGHT ASSET GENERATION + +## Quick Start + +```bash +# Run in background overnight +cd /Users/davidkotnik/repos/novafarma +nohup python3 scripts/generate_overnight.py > overnight_production.log 2>&1 & + +# Check progress +tail -f overnight_production.log + +# Check how many done +find assets/images -name "*.png" | wc -l +``` + +## What It Does + +- āœ… Generates ALL remaining assets from registry +- āœ… Rate limited: 60s between each asset +- āœ… Auto-commits every 20 assets +- āœ… Runs autonomously in background +- āœ… Logs everything to `overnight_production.log` + +## Details + +- **Total assets**: 422 +- **Already done**: ~38 +- **Remaining**: ~384 +- **Estimated time**: ~6.4 hours (384 Ɨ 60s) + +## Style + +All assets use approved **Dark Hand-Drawn 2D Stylized Indie** style: +- Bold thick black outlines +- Exaggerated proportions +- Green chroma key background +- Mature 90s cartoon aesthetic + +## Monitor Progress + +```bash +# Watch live log +tail -f overnight_production.log + +# Count generated files +find assets/images -name "*.png" | wc -l + +# Check git commits +git log --oneline | head -10 +``` + +## Stop If Needed + +```bash +# Find process +ps aux | grep generate_overnight + +# Kill it +kill +``` + +--- + +**Let it run overnight and wake up to 422 complete game assets!** šŸŒ™āœØ diff --git a/scripts/generate_overnight.py b/scripts/generate_overnight.py new file mode 100755 index 000000000..92d54b812 --- /dev/null +++ b/scripts/generate_overnight.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +""" +šŸŒ™ OVERNIGHT PRODUCTION - Automated Asset Generation +Generates remaining 384 assets slowly with rate limiting +Runs autonomously in background +""" +import time +import sys +from pathlib import Path + +# Add scripts to path +sys.path.insert(0, '/Users/davidkotnik/repos/novafarma/scripts') +from generate_v7_final import generate_registry, generate_image_google, setup_google_ai, OUTPUT_DIR + +# Configuration +BATCH_SIZE = 1 # Generate 1 at a time to avoid rate limits +WAIT_BETWEEN = 60 # 60 seconds between each asset +COMMIT_EVERY = 20 # Git commit every 20 assets + +def main(): + print("=" * 70) + print("šŸŒ™ OVERNIGHT ASSET PRODUCTION") + print("=" * 70) + + # Setup API + if not setup_google_ai(): + print("āŒ API key not configured") + return + + print("āœ… API configured\n") + + # Load registry + print("šŸ“‹ Loading asset registry...") + ASSETS = generate_registry() + print(f"šŸ“Š Total registry: {len(ASSETS)} assets\n") + + # Filter only missing assets + missing = [a for a in ASSETS if not (OUTPUT_DIR / a["cat"] / a["file"]).exists()] + print(f"šŸŽÆ Missing: {len(missing)} assets") + print(f"āœ… Existing: {len(ASSETS) - len(missing)} assets\n") + + if not missing: + print("šŸŽ‰ All assets already generated!") + return + + print(f"ā° Estimated time: {len(missing) * WAIT_BETWEEN // 3600} hours\n") + print("šŸš€ STARTING OVERNIGHT PRODUCTION...\n") + + success, fail = 0, 0 + commit_counter = 0 + + for i, asset in enumerate(missing, 1): + path = OUTPUT_DIR / asset["cat"] / asset["file"] + + print(f"[{i}/{len(missing)}] šŸŽØ {asset['file']}") + + try: + if generate_image_google(asset["prompt"], path): + print(f" āœ… SAVED to {asset['cat']}/") + success += 1 + commit_counter += 1 + + # Auto-commit every N assets + if commit_counter >= COMMIT_EVERY: + import subprocess + subprocess.run([ + "git", "-C", "/Users/davidkotnik/repos/novafarma", + "add", "assets/images/" + ]) + subprocess.run([ + "git", "-C", "/Users/davidkotnik/repos/novafarma", + "commit", "-m", + f"šŸŒ™ Overnight batch: {success} assets ({success}/{len(missing)})" + ]) + print(f"\nšŸ’¾ Git commit: {success} assets saved\n") + commit_counter = 0 + else: + print(f" āŒ FAILED") + fail += 1 + except Exception as e: + print(f" āš ļø ERROR: {e}") + fail += 1 + + # Progress report every 10 + if i % 10 == 0: + print(f"\nšŸ“Š Progress: {i}/{len(missing)} | āœ…{success} āŒ{fail}\n") + + # Rate limiting pause + if i < len(missing): # Don't wait after last one + print(f" ā³ Waiting {WAIT_BETWEEN}s...") + time.sleep(WAIT_BETWEEN) + + # Final commit + if commit_counter > 0: + import subprocess + subprocess.run([ + "git", "-C", "/Users/davidkotnik/repos/novafarma", + "add", "assets/images/" + ]) + subprocess.run([ + "git", "-C", "/Users/davidkotnik/repos/novafarma", + "commit", "-m", + f"šŸŽ‰ Overnight complete: {success} total assets" + ]) + + print("\n" + "=" * 70) + print("šŸŽ‰ OVERNIGHT PRODUCTION COMPLETE!") + print(f"āœ… Success: {success} | āŒ Fail: {fail}") + print("=" * 70) + +if __name__ == "__main__": + main()