File size: 2,358 Bytes
9bc4f6e
 
5d0bada
 
 
9bc4f6e
369d427
9bc4f6e
 
 
5d0bada
9bc4f6e
 
5d0bada
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Character Studio
emoji: 🎭
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 5.9.1
app_file: app.py
pinned: false
license: apache-2.0
short_description: Multi-model character generator on ZeroGPU
---

# 🎭 Character Studio

A Hugging Face **ZeroGPU** Space that bundles many image models behind one UI for
character generation. Pick a model from an **editable registry**, type a prompt,
optionally drop a **reference image**, and generate.

## Features
- **Editable model registry** β€” add / remove models by editing `models.json`, no code change.
- **Multiple base families** β€” SD1.5, SDXL, FLUX. Each model declares its own `base`.
- **Multiple input modes** β€” `txt2img`, `img2img`, `IP-Adapter` (style/subject), `Face identity` (FaceID).
- **Custom sources** β€” HF repos, full `.safetensors` checkpoints, and Civitai download URLs.

## Hardware
Set the Space hardware to **ZeroGPU** (Nvidia, dynamic). Free tier works; pipelines
are cached on CPU and moved to GPU only during a generation call.

## Secrets / environment variables (Settings β†’ Variables and secrets)
- `HF_TOKEN` β€” needed only for **gated** models (e.g. FLUX.1-dev). Optional otherwise.
- `CIVITAI_TOKEN` β€” needed only if a registry entry pulls from a Civitai download URL.

## Adding / removing models
See **README_TH.md** for the full Thai field guide. Quick version: each entry in
`models.json` looks like:

```json
{
  "id": "my-model",
  "label": "My Model (SDXL)",
  "base": "sdxl",
  "type": "checkpoint",
  "repo_id": "author/repo-on-hf",
  "single_file_url": null,
  "default_steps": 30,
  "default_guidance": 6.0,
  "enabled": true
}
```

For a LoRA, set `"type": "lora"`, keep `repo_id` as the **base checkpoint**, and add
either `lora_repo_id` (+ optional `lora_weight_name`) or `lora_url` (Civitai), plus
`lora_scale`. After editing, click **πŸ”„ Reload models** in the UI.

## Notes
- IP-Adapter and Face identity modes are available for **SD1.5 / SDXL** only; FLUX
  supports `txt2img` / `img2img`.
- Face identity uses InsightFace (`buffalo_l`) + IP-Adapter-FaceID and needs a clear face.
- Only one large model is held in memory at a time; switching models reloads.

## Responsible use
This tool is for original character art and authorized creative work. Do not use the
Face identity feature to depict real people without their consent.