An AI-powered forge for indie developers to generate and transform game assets. Upload a base sprite and instantly create endless fantasy variations using the FLUX.1 Kontext [dev] model.
This project was built for the Black Forest Labs - FLUX.1 Kontext [dev] Hackathon.
🎥 Watch the demo video here: YouTube link
- Dual Generation Modes: Choose between two powerful modes for different creative needs.
- 🎨 Inspiration Mode: Upload a base asset and instantly generate four unique, stylized variations (Fiery, Icy, Ancient, Magic) to spark new ideas.
- 🎯 Single Image Mode: Take full control by writing a detailed prompt to generate a single, specific asset.
- Interactive UI: A simple and intuitive web interface built with Gradio. No command line needed.
- Clickable Examples: Get started immediately by selecting one of the built-in examples (shield, mace, potion, boots).
- Core AI Model: FLUX.1 Kontext [dev] by Black Forest Labs
- Cloud Inference: fal.ai for running the model via API
- Web Interface: Gradio for creating the interactive UI
- Core Language: Python
- Key Libraries: Pillow (for image processing), Requests (for handling web data)
Follow these steps to get the application running locally.
git clone https://github.com/vero-code/gameassets-ai.git
cd gameassets-ai# Create and activate the virtual environment
python -m venv venv
venv\Scripts\activate
# Install required packages
pip install -r requirements.txtCreate a folder named assets in the project's root directory and download the example images into it.
-
Get your API key from fal.ai.
-
Create a file named
.envin the project's root directory. -
Add your key to the file like this:
FAL_KEY="your_fal_key_here"
With your environment activated and the .env file in place, run the application:
python src/app.pyThis will start a local web server. Open the URL provided in the terminal (usually http://127.0.0.1:7860) in your web browser to use the app.
Run test script:
python src/test_api.py
It will send a request to FLUX.1 Kontext [dev] and return a generated image URL.
Example output:
Generated image URL: https://v3b.fal.media/files/...jpg Size: 832 x 448 Inference time: 1.26 seconds
gameassets-ai/
├─ assets/
│ └─ ...
├─ src/
│ ├─ app.py
│ └─ test_api.py
├─ venv/
├─ .env.example
├─ .gitignore
├─ README.md
└─ requirements.txt
This project is licensed under the MIT License.
