leemoonkyu/Character_Design_Request
1
✨ AI Doodle Character Sheet Generator
Upload any character or person photo and get a kawaii doodle-collage character sheet — analyzed with GPT-4o Vision and generated with DALL-E 3.
How It Works
Deploy to Hugging Face Spaces (Docker)
Step 1 — Create a new Space
- Go to huggingface.co/new-space
- Give it a name (e.g.
ai-doodle-generator) - Select Docker as the SDK
- Set visibility to Public or Private
- Click Create Space
Step 2 — Add your OpenAI API key as a Secret
- Open your Space → Settings tab
- Scroll to Variables and secrets → click New secret
- Name:
OPENAI_API_KEY/ Value: your key (sk-...) - Click Save
Secrets are encrypted and injected as environment variables at runtime. Never put your API key in the code or commit it to git.
Step 3 — Push your files
Option A — Git (recommended):
# Clone the empty Space
git clone https://huggingface.co/spaces/YOUR_USERNAME/ai-doodle-generator
cd ai-doodle-generator
# Copy your files in, then push
git add app.py requirements.txt Dockerfile README.md
git commit -m "Initial deploy"
git pushOption B — HF web UI:
Go to your Space → Files → Add file → upload all four files.
HF Spaces reads README.md for the YAML frontmatter (sdk: docker, app_port: 7860), builds the Docker image from Dockerfile, and starts the container automatically.
Step 4 — Watch the build
Click the Logs tab to follow the Docker build in real time. A green Running badge means the app is live.
GitHub → HF Spaces Auto-Deploy
Add this file to your GitHub repo:
# .github/workflows/deploy.yml
name: Deploy to HF Spaces
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to HF Spaces
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git remote add space https://YOUR_USERNAME:$HF_TOKEN@huggingface.co/spaces/YOUR_USERNAME/ai-doodle-generator
git push space main --forceAdd HF_TOKEN (a Hugging Face write token) to your GitHub repo secrets. Every push to main will automatically redeploy the Space.
Local Development
# Build and run with Docker
docker build -t ai-doodle-generator .
docker run -p 7860:7860 -e OPENAI_API_KEY="sk-your-key-here" ai-doodle-generator
# Open http://localhost:7860
# Or run directly with Python
pip install -r requirements.txt
export OPENAI_API_KEY="sk-your-key-here" # macOS/Linux
# $env:OPENAI_API_KEY="sk-your-key-here" # Windows PowerShell
python app.pyProject Structure
ai-doodle-generator/
├── app.py # Gradio app — full 3-step pipeline
├── requirements.txt # Python dependencies
├── Dockerfile # Docker config for HF Spaces
└── README.md # This file (also the HF Spaces config via frontmatter)Tech Stack
- Gradio — UI framework
- OpenAI GPT-4o — Vision analysis + prompt crafting
- DALL-E 3 — Image generation
- Hugging Face Spaces — Hosting (Docker SDK)
Cost per Generation (approximate)
License
MIT
