File size: 5,246 Bytes
5b6e956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# Quick Start Guide

Get up and running with Character Forge in 5 minutes!

## Step 1: Get Your API Key

1. Visit https://aistudio.google.com/app/apikey
2. Sign in with your Google account
3. Click "Create API Key" β†’ "Create API key in new project"
4. Copy your key (starts with `AIzaSy...`)
5. Keep it safe and secret!

**Cost**: ~$0.03 per image | Free tier available

## Step 2: Choose Your Installation

### Option A: Local Installation (Recommended)

**Windows:**
```cmd
# Install
install.bat

# Set your API key
set GEMINI_API_KEY=your-key-here

# Run
start.bat
```

**Linux/Mac:**
```bash
# Install
chmod +x install.sh
./install.sh

# Set your API key
export GEMINI_API_KEY=your-key-here

# Run
chmod +x start.sh
./start.sh
```

**Open browser**: http://localhost:8501

### Option B: HuggingFace Spaces (Online)

1. Go to https://huggingface.co/spaces
2. Click "Create new Space"
3. Upload Character Forge files
4. Add API key in Repository Secrets
5. Launch!

**See**: [HUGGINGFACE_DEPLOYMENT.md](HUGGINGFACE_DEPLOYMENT.md) for detailed instructions

## Step 3: Create Your First Character Sheet

1. Open the app (localhost:8501 or your HF Space)
2. Click "πŸ”₯ Character Forge" in the sidebar
3. Upload a clear photo (face or full body)
4. Click "Generate Character Sheet"
5. Wait 2-3 minutes
6. Download your complete character sheet!

**Result**: 5 professionally composed views of your character

## Step 4: Use Your Character Sheet

Your character sheet can be used for:

- βœ… Consistent character generation in new scenes
- βœ… Multi-character compositions
- βœ… Animation reference
- βœ… Game development
- βœ… Storyboarding

## Features Overview

### πŸ”₯ Character Forge

**Create complete character sheets from one image**

- Upload 1 image β†’ Get 5 views
- Front/side faces + front/side/back body
- Auto-composited into single sheet
- 2-3 minutes total time

### 🎬 Composition Assistant

**Smart multi-image composition**

- Upload 1-3 images
- Auto-detection of image types
- AI-generated composition prompts
- Professional results

### πŸ“Έ Standard Interface

**Direct image generation**

- Text-to-image
- Image-to-image
- Multiple aspect ratios
- Temperature control

### πŸ“š Library

**Save and organize your assets**

- Characters
- Backgrounds
- Styles
- Quick reuse

## Tips for Success

### For Character Sheets

βœ… **DO:**
- Use clear, well-lit photos
- Front-facing works best
- Simple backgrounds preferred
- High resolution helps

❌ **DON'T:**
- Use blurry images
- Too much background clutter
- Extreme angles
- Multiple people in frame

### For Best Quality

**Temperature Settings:**
- **0.0-0.3**: Consistent, follows prompt closely
- **0.4-0.6**: Balanced (recommended)
- **0.7-1.0**: Creative, more variation

**Prompts:**
- Be specific and descriptive
- Include style keywords ("photorealistic", "digital art")
- Mention lighting and composition
- Add detail about mood and atmosphere

### Cost Management

**Optimize your usage:**
- Preview before generating
- Use lower temperature for consistency (fewer retries)
- Batch similar tasks together
- Save good results to library for reuse

**Typical costs with Gemini API:**
- Single image: ~$0.03
- Character sheet: ~$0.15 (5 images)
- Composition: ~$0.03-0.06 (1-2 images)

## Common Use Cases

### Game Development

1. Create character sheets for all NPCs
2. Generate environment backgrounds
3. Create texture variations
4. Compose characters into scenes

### Animation

1. Generate character reference sheets
2. Create background art
3. Develop style references
4. Storyboard scene composition

### Creative Projects

1. Illustrate stories
2. Concept art development
3. Visual worldbuilding
4. Character design iteration

## Troubleshooting

### "API Key Not Set"

**Solution:**
- Set environment variable before running
- OR enter key in sidebar when app starts
- OR use HF Spaces Repository Secrets

### "Generation Failed"

**Possible causes:**
- Content policy violation (try rephrasing)
- Rate limit (wait a moment)
- Network issue (check connection)
- Invalid API key (verify it's correct)

**Try:**
1. Rephrase your prompt
2. Adjust temperature
3. Try a different image
4. Check API key is valid

### "Slow Generation"

**Normal timing:**
- Single image: 10-30 seconds
- Character sheet: 2-3 minutes
- Composition: 20-60 seconds

**If slower:**
- Check internet connection
- Verify API quota not exceeded
- Try during off-peak hours

### Port Already in Use

**Solution:**
```bash
# Kill existing process
# Windows:
taskkill /IM streamlit.exe /F

# Linux/Mac:
pkill -f streamlit
```

Or edit `app.py` to use different port.

## Next Steps

Now that you're set up:

1. βœ… Generate your first character sheet
2. βœ… Try the composition assistant
3. βœ… Experiment with different temperatures
4. βœ… Build your asset library
5. βœ… Integrate into your workflow

## Need Help?

- **Documentation**: See `/docs` folder
- **Examples**: Check the workflow examples
- **Issues**: Report on GitHub
- **API Help**: https://ai.google.dev/

## Resources

- **Gemini API Docs**: https://ai.google.dev/
- **Streamlit Docs**: https://docs.streamlit.io/
- **HuggingFace Spaces**: https://huggingface.co/docs/hub/spaces

---

**Happy Creating! 🎨**