File size: 6,894 Bytes
b486c87
 
 
 
e494e0c
b486c87
 
 
 
 
 
5b6e956
 
 
 
 
b486c87
5b6e956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f71f743
5b6e956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f71f743
 
5b6e956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f71f743
5b6e956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b486c87
5b6e956
 
 
 
 
 
 
 
f71f743
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
---
title: Character Forge
emoji: πŸ”₯
colorFrom: red
colorTo: yellow
sdk: docker
pinned: false
license: agpl-3.0
app_port: 7860
---

# πŸ”₯ Character Forge

**Professional AI Image Generation with Automated Character Sheets**

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![HuggingFace](https://img.shields.io/badge/πŸ€—%20Hugging%20Face-Spaces-yellow)](https://huggingface.co/spaces/ghmk/character_forge)

---

## What is Character Forge?

Character Forge is a powerful AI image generation platform featuring:

✨ **Character Sheet Generation**: Transform a single image into a complete multi-angle character sheet automatically
🎬 **Composition Assistant**: Smart multi-image composition with auto-generated prompts
πŸ“Έ **Standard Interface**: Direct text-to-image and image-to-image generation
πŸ“š **Library Management**: Save and reuse characters, backgrounds, and styles
πŸ”Œ **Multi-Backend Support**: Use Gemini API (cloud) or run locally with ComfyUI

---

## πŸš€ Quick Start

### Option 1: HuggingFace Spaces (Easiest)

Click the "Use this space" button on HuggingFace to deploy your own instance:

1. Fork/Duplicate this space
2. Go to Settings β†’ Repository Secrets
3. Add your `GEMINI_API_KEY` (get one free at [Google AI Studio](https://aistudio.google.com/app/apikey))
4. Launch the space!

### Option 2: Local Installation

**Prerequisites:**
- Python 3.10 or higher
- Google Gemini API key (get it [here](https://aistudio.google.com/app/apikey))

**Installation:**

```bash
# Clone the repository
git clone https://github.com/yourusername/character-forge.git
cd character-forge

# Install dependencies
pip install -r requirements.txt

# Set your API key
export GEMINI_API_KEY="your-api-key-here"  # Linux/Mac
# OR
set GEMINI_API_KEY=your-api-key-here  # Windows

# Run the application
cd character_forge_image
streamlit run app.py
```

Open your browser to `http://localhost:8501`

---

## 🎯 Key Features

### 1. Character Forge

Transform ONE image into a complete character sheet:

- **2 Facial Views**: Front portrait + Side profile
- **3 Body Views**: Front + Side + Rear full body shots
- **Auto-Composited**: Single image ready for consistent character generation
- **Fast**: ~2-3 minutes, fully automated
- **Cost Effective**: ~$0.15 total for complete sheet (with Gemini API)

Perfect for:
- Game development
- Animation pipelines
- Consistent character generation
- Multi-character scenes

### 2. Composition Assistant

Intelligently compose multiple images:

- Upload 1-3 images
- Auto-detect image types (subject, background, style reference)
- AI-generated composition prompts
- Professional results with minimal manual work

### 3. Standard Interface

Direct image generation:

- Text-to-image
- Image-to-image transformation
- Multiple aspect ratios (1:1, 16:9, 9:16, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 21:9)
- Temperature control for creativity vs consistency

### 4. Library Management

Build your asset library:

- Save generated characters
- Organize backgrounds and environments
- Store style references
- Quick access for future compositions

---

## πŸ”§ Backend Options

### Gemini API (Cloud) - Default

**Best for getting started:**
- No local installation needed
- High quality results
- ~$0.03 per image
- Free tier available

**Setup:**
1. Get API key from [Google AI Studio](https://aistudio.google.com/app/apikey)
2. Set as environment variable or enter in UI
3. Start generating!

### ComfyUI (Local) - Advanced

**For power users:**
- Complete control
- No per-image costs
- GPU required
- Advanced workflows supported

**Setup:** See [COMFYUI_SETUP.md](docs/COMFYUI_SETUP.md)

---

## πŸ“– Documentation

- **Quick Start Guide**: You're reading it!
- **Character Sheet Tutorial**: [docs/CHARACTER_SHEETS.md](docs/CHARACTER_SHEETS.md)
- **Composition Guide**: [docs/COMPOSITION_ASSISTANT.md](docs/COMPOSITION_ASSISTANT.md)
- **ComfyUI Integration**: [docs/COMFYUI_SETUP.md](docs/COMFYUI_SETUP.md)
- **API Reference**: [docs/API.md](docs/API.md)

---

## πŸ’‘ Tips for Best Results

### Character Sheets
- Use clear, well-lit source images
- Front-facing photos work best
- Simple backgrounds preferred
- High resolution helps (but not required)

### Composition
- Generate subjects separately from backgrounds
- Use consistent lighting across images
- Be specific in your prompts
- Experiment with temperature settings

### General
- **Temperature 0.0-0.3**: Conservative, consistent
- **Temperature 0.4-0.6**: Balanced (recommended)
- **Temperature 0.7-1.0**: Creative, varied

---

## 🀝 Contributing

Contributions are welcome! Please feel free to:

- Report bugs
- Suggest features
- Submit pull requests
- Improve documentation

---

## πŸ“ License

GNU Affero General Public License v3.0 (AGPL-3.0)

**What this means:**

βœ“ **Free to use**: Personal, educational, and research use is completely free
βœ“ **Your content is yours**: Images and characters you generate belong to you
βœ“ **Modify freely**: You can modify and improve the software
βœ“ **Share improvements**: Modified versions must also be open source

βœ— **No proprietary integration**: Cannot be integrated into closed-source commercial products
βœ— **Network use = source sharing**: If you run this as a service, you must share your source code

**For commercial services or products**, any modifications or integrations must be released
under AGPL-3.0. This ensures the software remains free and open for everyone.

**For generated content**: Your images, characters, and creative outputs are yours to use
however you want - commercially or otherwise. The AGPL only applies to the software itself.

See [LICENSE](LICENSE) for full details and [NOTICE](NOTICE) for important information.

For commercial licensing inquiries or questions, please contact the authors.
## πŸ™ Acknowledgments

- Google for the Gemini 2.5 Flash Image API
- Streamlit for the excellent UI framework
- The ComfyUI community
- All contributors and users

---

## πŸ”— Links

- **Documentation**: [Full documentation](docs/)
- **Google Gemini API**: https://ai.google.dev/
- **Streamlit**: https://streamlit.app/
- **Report Issues**: [GitHub Issues](https://github.com/yourusername/character-forge/issues)

---

## ❓ FAQ

**Q: How much does it cost?**
A: With Gemini API: ~$0.03 per image. Free tier available for testing.

**Q: Do I need a GPU?**
A: Only for local ComfyUI backend. Gemini API runs in the cloud.

**Q: Can I use this commercially?**
A: Generated images are yours to use commercially. The software code must remain open source (AGPL).

**Q: Is my data private?**
A: With Gemini API, images are processed by Google. For complete privacy, use ComfyUI locally.

**Q: What image formats are supported?**
A: PNG, JPEG, WebP for input and output.

---

**Made with ❀️ by the Character Forge team**