AI_BoardGames_Forge / README.md
GhalaDev's picture
Upload 3 files
fbd50df verified
|
Raw History Blame Contribute Delete
1.59 kB
---
title: AI BoardGame Forge
colorFrom: blue
colorTo: purple
sdk: gradio
app_file: app.py
pinned: false
---
# AI BoardGame Forge
A web app that turns any theme into a mini card game with AI-generated text
and AI-generated artwork.
Enter a theme, such as "Space Cats" or "Ancient Pirates", or pick one of the
example themes provided, and the app generates a game title, description,
rules, and 4 unique cards, each with its own AI-generated artwork.
## How it works
- Game text (title, description, rules, cards) is generated by
Qwen2.5-0.5B-Instruct, a small, free, open-source language model that
runs locally through the Hugging Face `transformers` library. No API key
or account is needed.
- If the model's reply cannot be parsed as valid JSON with exactly 4 cards,
the app falls back to a local template generator so it never breaks.
- Card artwork is generated using Pollinations.ai, a free image generation
service that also requires no API key. If an image request fails, a
themed placeholder image is used instead.
- Each card is composed into a trading-card layout using Pillow (PIL).
- The interface is built with Gradio.
## Files
- `app.py`: the full application code
- `requirements.txt`: the Python packages needed to run it
## Notes on hardware
This Space loads a small language model in addition to making image
requests, so the free CPU tier works but the first response after startup
may take a bit longer while the model loads into memory. Generating a full
game typically takes somewhere between 20 and 90 seconds depending on
available compute.