File size: 4,808 Bytes
4fac583
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/usr/bin/env python3
"""
Create Example Images for Character Forge Documentation
========================================================
Licensed under GNU AGPL v3.0

This script helps create example images for the README and documentation.
It generates examples for each major feature.
"""

import os
import sys
from pathlib import Path

print("="*70)
print("Character Forge - Example Generator")
print("="*70)

# Check for API key
api_key = os.environ.get("GEMINI_API_KEY")
if not api_key:
    print("\n❌ ERROR: GEMINI_API_KEY not set!")
    print("\nPlease set your API key:")
    print("  Windows: set GEMINI_API_KEY=your-key-here")
    print("  Linux/Mac: export GEMINI_API_KEY=your-key-here")
    print("\nGet a free API key at: https://aistudio.google.com/app/apikey")
    sys.exit(1)

print(f"\n✅ API Key found: {api_key[:10]}...")

# Create examples directory
examples_dir = Path("docs/examples")
examples_dir.mkdir(parents=True, exist_ok=True)
print(f"✅ Examples directory: {examples_dir.absolute()}")

print("\n" + "="*70)
print("MANUAL GENERATION INSTRUCTIONS")
print("="*70)

print("""
To create the example images, follow these steps:

1. START THE APP
   ------------------
   cd D:/hu/character_forge/character_forge_image
   streamlit run app.py

2. ENTER YOUR API KEY
   ------------------
   - Look at the sidebar
   - Enter your API key in the "Gemini API Key" field

3. GENERATE CHARACTER FORGE EXAMPLE
   ----------------------------------
   Page: 🔥 Character Forge

   Option A - Use Text Prompt:
   Prompt: "A young female elf warrior with long silver hair and
            green eyes, wearing leather armor, fantasy RPG character
            design, detailed portrait, high quality"

   Option B - Upload Initial Image:
   - Find or generate a character portrait first
   - Upload it to Character Forge
   - Let it generate 5 views

   Click: "Generate Character Sheet"
   Wait: ~2-3 minutes
   Save: Download the final character sheet
   Name: character_forge_output.png

4. GENERATE COMPOSITION EXAMPLE
   ----------------------------
   Page: 🎬 Composition Assistant

   Upload Image 1:
   - Type: "Subject/Character"
   - Prompt: "Female warrior in leather armor"

   Upload Image 2:
   - Type: "Background/Environment"
   - Prompt: "Medieval castle courtyard at sunset"

   Composition Prompt: "Warrior standing confidently in castle
                        courtyard, epic fantasy scene, cinematic
                        lighting, dramatic atmosphere"

   Click: "Generate Composition"
   Wait: ~30 seconds
   Save: Download the result
   Name: composition_output.png

5. GENERATE STANDARD EXAMPLE
   --------------------------
   Page: 📸 Standard Interface

   Prompt: "A majestic blue dragon flying over snowy mountain
            peaks at golden hour, fantasy art, dramatic lighting,
            volumetric clouds, 4k digital art"

   Aspect Ratio: 16:9 (1344x768)
   Temperature: 0.5

   Click: "Generate Image"
   Wait: ~30 seconds
   Save: Download the result
   Name: standard_output.png

6. SAVE ALL IMAGES
   ---------------
   Save all generated images to:
   D:/hu/character_forge/docs/examples/

   Required files:
   - character_forge_output.png (the 5-view character sheet)
   - composition_output.png (composed scene)
   - standard_output.png (dragon landscape)

7. VERIFY FILE SIZES
   -----------------
   After saving, run this script again to verify!
""")

print("\n" + "="*70)
print("CHECKING FOR EXISTING EXAMPLES...")
print("="*70)

required_files = [
    "character_forge_output.png",
    "composition_output.png",
    "standard_output.png"
]

found = []
missing = []

for filename in required_files:
    filepath = examples_dir / filename
    if filepath.exists():
        size_mb = filepath.stat().st_size / (1024 * 1024)
        print(f"✅ {filename} ({size_mb:.2f} MB)")
        found.append(filename)
    else:
        print(f"❌ {filename} (not found)")
        missing.append(filename)

print("\n" + "="*70)
if missing:
    print(f"STATUS: {len(found)}/{len(required_files)} examples ready")
    print("="*70)
    print("\nNext steps:")
    print("1. Follow the instructions above to generate missing examples")
    print("2. Save them to: docs/examples/")
    print("3. Run this script again to verify")
else:
    print("✅ ALL EXAMPLES READY!")
    print("="*70)
    print("\nNext steps:")
    print("1. Run: python update_readme_with_examples.py")
    print("2. Review the updated README.md")
    print("3. Commit and push to HuggingFace")

print("\n" + "="*70)
print("ESTIMATED COST")
print("="*70)
print("Character Forge: ~$0.15 (5 images)")
print("Composition:     ~$0.03 (1 image)")
print("Standard:        ~$0.03 (1 image)")
print("-----------------------------------")
print("TOTAL:           ~$0.21")
print("="*70)