This Django API converts images to pixel art using Google's Gemini API.
-
Install dependencies:
pip install -r requirements.txt
-
Set up your Gemini API key:
# Copy the example file cp .env.example .env # Edit .env and add your API key # Get your key from: https://aistudio.google.com/app/apikey
-
Add your reference pixel art image: Place your reference pixel art sprite at
media/pixel_art/reference.png -
Run the Django server:
python manage.py runserver
-
Test Gemini setup:
python test_gemini.py
-
Test the API endpoint:
python test_api_request.py
If you're getting pixelated output instead of AI-generated pixel art:
- Check the Django server console for error messages
- Verify your API key is correct
- Ensure you have an active internet connection
- Check if the Gemini API service is available
The API will fall back to simple pixelation if the Gemini API fails.