A full-stack application for generating game assets using runware and claude api.
-
3-Node Pipeline Workflow: Intuitive step-by-step asset configuration
- Node 1: Enter your game idea
- Node 2: Configure game style, characters, backgrounds, and dialogue
- Node 3: Validate prompts and generate assets
-
Prompt Validation: Uses Claude API to validate and sanitize user inputs against prompt injection attacks
-
Parallel Asset Generation: Generates multiple assets simultaneously using Runware API
- Characters (with automatic background removal)
- Backgrounds (stylized or realistic)
- Dialogue images
-
Studio Dashboard: Organized asset browser with tree navigation following unity best practice (https://unity.com/how-to/organizing-your-project)
- Preview images, audio, and dialogue files
- Download individual assets or all as ZIP
-
Multi-Session Support: Create up to 3 generation sessions in tabs
- TypeScript
- Tailwind CSS (styling)
- shadcn/ui (component library)
- React Flow (pipeline visualization)
- Framer Motion (animations)
- JSZip (asset downloading)
- Python 3.11+
- FastAPI (API framework)
- Pydantic (data validation)
- Anthropic SDK (Claude API)
- HTTPX (async HTTP client)
- SSE-Starlette (Server-Sent Events)
- Node.js 18+
- Python 3.11+
- Anthropic API key
- Runware API key
cd frontend
npm installcd backend
pip install -r requirements.txtCreate a .env file in the backend directory:
cd backend
cp .env.example .env
# Edit .env with your API keysRequired environment variables:
ANTHROPIC_API_KEY: Your Anthropic API key for ClaudeRUNWARE_API_KEY: Your Runware API key for image generation
Start the backend:
cd backend
uvicorn main:app --reload --port 8000Start the frontend (in a new terminal):
cd frontend
npm run devThe application will be available at http://localhost:5173
Validate and optimize game asset prompts.
Request Body:
{
"rawIdea": "A retro RPG dungeon crawler",
"gameStyle": "rpg-pixel",
"dialogueType": "text",
"characters": [
{
"id": "hero",
"name": "Hero",
"description": "A brave knight with silver armor"
}
],
"backgroundDescription": "Dark dungeon with torches",
"useRealisticBackground": false
}Start asset generation process.
Request Body: Validated manifest from /api/validate
Response:
{
"sessionId": "uuid-string"
}Get session details and asset status.
Stream session updates via Server-Sent Events.
The application uses the following Runware models:
| Use Case | Model | Model ID |
|---|---|---|
| Characters & Stylized Assets | FLUX.2 klein | runware:400@3 |
| Dialogue Text Images | FLUX.1 dev | runware:101@1 |
| Realistic Backgrounds | FLUX pro | bfl:5@1 |
| Background Removal | BiRefNet | runware:112@5 |
.
├── backend
│ ├── main.py
│ ├── models.py
│ ├── requirements.txt
│ ├── runware_service.py
│ └── validation_service.py
├── frontend
│ ├── index.html
│ ├── package.json
│ ├── package-lock.json
│ ├── README.md
│ ├── src
│ │ ├── App.tsx
│ │ ├── components
│ │ │ ├── pipeline
│ │ │ │ └── Pipeline.tsx
│ │ │ ├── studio
│ │ │ │ ├── AssetPreview.tsx
│ │ │ │ ├── AssetTree.tsx
│ │ │ │ └── Studio.tsx
│ │ │ └── ui
│ │ │ ├── Button.tsx
│ │ │ ├── Card.tsx
│ │ │ ├── Dialog.tsx
│ │ │ ├── Input.tsx
│ │ │ ├── Label.tsx
│ │ │ ├── Select.tsx
│ │ │ └── Textarea.tsx
│ │ ├── index.css
│ │ ├── lib
│ │ │ ├── api.ts
│ │ │ └── utils.ts
│ │ ├── main.tsx
│ │ ├── pages
│ │ │ ├── LandingPage.tsx
│ │ │ └── StudioPage.tsx
│ │ └── types
│ │ └── index.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
├── LICENSE
└── README.md
The application includes prompt injection protection following OWASP (TO-DO):
MIT