Youtube thumbnail generator

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.

ThumbGen UI

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.txt

Start the server:

uvicorn main:app --reload --port 8000

Open the UI:

http://localhost:8000

Thumbnail Styles

The generator includes several built-in styles.

IDStyleDescription
dark_mystical🌌 Dark Mysticalblack + gold aesthetic
neon_science⚡ Neon Sciencecyberpunk scientific vibe
minimal_light☀️ Minimal Lightclean minimal white
golden_sacred✨ Golden Sacredsacred geometry theme
deep_space🔮 Deep Spacecosmic / 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 | sh

Download a model:

ollama pull phi3:mini

Now the UI button "Suggest text (AI)" will generate titles for thumbnails.

Example flow:

Topic → AI → Title suggestion → Thumbnail generator

Recommended Models for CPU

If you run this on a laptop CPU:

ModelRAMSpeed
phi3:mini~2GBvery fast
llama3.2:3b~2GBfast
mistral:7b~4GBslower 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.

AI

06-03-2026

Local Voice Assistant with Ollama
  • Build your own local voice assistant powered by Ollama.

AI

06-03-2026

AI YouTube Thumbnail Generator
  • Generate YouTube thumbnails with FastAPI and Ollama.

Architecture

05-09-2024

Graph DB usage comparison
  • Compare Neo4j and Tigergraph databases, which is easier to work with, etc.