AI YouTube Thumbnail Generator
Kacper Walczak · 06-03-2026
Generate YouTube thumbnails with Python, FastAPI and optional Ollama AI.
Creating YouTube thumbnails is usually a manual process.
Open Photoshop.
Pick fonts.
Add emojis.
Align text.
This small project automates the whole process using Python + Pillow.
Optionally it can also use Ollama AI to generate better titles.
Example UI
You open the web interface and generate thumbnails instantly.
![]()
The generator allows selecting different visual styles and generates thumbnails in seconds.
Architecture
The project is intentionally simple.
Frontend (HTML UI)
↓
FastAPI backend
↓
Thumbnail generator (Pillow)
↓
Optional Ollama AI text improvement
Everything runs locally.
No cloud required.
Project Structure
thumbgen/
├── main.py # FastAPI backend
├── generator.py # Pillow image generator
├── requirements.txt
├── static/
│ └── index.html # frontend
└── output/ # generated thumbnails
Setup
pip install -r requirements.txtStart the server:
uvicorn main:app --reload --port 8000Open the UI:
http://localhost:8000Thumbnail Styles
The generator includes several built-in styles.
| ID | Style | Description |
|---|---|---|
dark_mystical | 🌌 Dark Mystical | black + gold aesthetic |
neon_science | ⚡ Neon Science | cyberpunk scientific vibe |
minimal_light | ☀️ Minimal Light | clean minimal white |
golden_sacred | ✨ Golden Sacred | sacred geometry theme |
deep_space | 🔮 Deep Space | cosmic / quantum style |
Each style controls:
- background
- font
- color palette
- layout
Generating Thumbnails via API
You can also generate thumbnails via HTTP.
Example request:
curl -X POST http://localhost:8000/generate \
-H "Content-Type: application/json" \
-d '{"title": "Consciousness appears at 6Hz", "style": "neon_science", "emoji": "🧠"}'The image will be saved in the output/ folder.
Using Ollama AI
The project optionally integrates with Ollama.
Install Ollama:
curl -fsSL https://ollama.com/install.sh | shDownload a model:
ollama pull phi3:miniNow the UI button "Suggest text (AI)" will generate titles for thumbnails.
Example flow:
Topic → AI → Title suggestion → Thumbnail generatorRecommended Models for CPU
If you run this on a laptop CPU:
| Model | RAM | Speed |
|---|---|---|
| phi3:mini | ~2GB | very fast |
| llama3.2:3b | ~2GB | fast |
| mistral:7b | ~4GB | slower but better |
For most setups phi3:mini is the best balance.
Why this tool exists
Thumbnail generators online often require:
- subscriptions
- cloud APIs
- uploading your data
This tool is:
- local
- simple
- extensible
- hackable
You can easily modify styles or integrate it into your own pipeline.
Conclusion
Combining small tools like:
- FastAPI
- Pillow
- Ollama
makes it easy to build practical AI-assisted utilities.
Instead of relying on big platforms, you can build your own tools that run completely locally.
READ
Latest readings
Readings are sites which will help you with detailed
information about given topic. Read latest ones from Learn.
06-03-2026
Build your own local voice assistant powered by Ollama.
06-03-2026
Generate YouTube thumbnails with FastAPI and Ollama.
05-09-2024
Compare Neo4j and Tigergraph databases, which is easier to work with, etc.