ThumbnailCreator command to generate a YouTube cover image

“Enter a topic, and AI will help you come up with ideas, generate materials, typeset and add words, and generate a 1280×720 YouTube thumbnail in seconds.”

In the world of content creators, cover images often determine the first impression of a video.
But every design has to be repeatedly colored, selected, and cutout? This can be done by AI.

This article will give you a quick overview of an open-source automatic cover generator – yt_thumbnail_creator.

What is it

yt_thumbnail_creator is an open source project based on Python,
 Automatically generate creative YouTube cover images through LLM (Large Language Model) + Stable Diffusion collaboration.

  • LLMs are responsible for: conceptualizing topics and generating prompts
  • Stable Diffusion is responsible for: drawing the image material
  • The program is automatic: remove the background, add text, and synthesize the final thumbnail

The entire process requires little human intervention and can be completed with a single command.

Core features:

  • Smart Creativity: Input a topic and automatically generate visual keywords and prompts
  • High-Quality Footage: Generate corresponding images with Stable Diffusion
  • Auto-cutout: Remove background with the help rembg of Remove Background
  • Text Layout: Add the title text to the appropriate place
  • One-click export: Output standard cover sizes of 1280×720

The code structure is clear, all configurations yt_thumb_gen.py are centralized, and it is extremely easy to modify.

Dependencies and installations

Project environment dependencies:

Python 3.7+
pip install gradio_client Pillow rembg colorama

Installation Steps:

git clone https://github.com/Likhithsai2580/yt_thumbnail_creator.git
cd yt_thumbnail_creator
pip install -r requirements.txt

Then prepare a custom LLM implementation file in your project:

llm/llama.py

This file can be your own API call (such as OpenAI or other local models).

How to use:

Execute the command:

python yt_thumb_gen.py --topic "How to Learn Calculus Fast"

After running, the program will automatically:

  1. Invoke the LLM to generate prompts;
  2. Generate image materials;
  3. cutout and synthesis;
  4. Add the title text;
  5. Export the final thumbnail to THUMBNAIL_PATH.

The output size defaults to 1280×720 and can also be modified in the script.

Overview of the project structure

yt_thumbnail_creator/
│
├── llm/ # 自定义语言模型调用逻辑
├── static/ # 存放素材文件
├── yt_thumb_gen.py # 主程序,包含生成逻辑
└── requirements.txt # 环境依赖

Key functions:

  • generate_assets(topic): Generate topic material
  • remove_bg_from_asset(): Automatically remove background
  • add_text_to_thumbnail(): Add title text

Configurable

You can adjust directly in the script:

Configure itemsDescription
THUMBNAIL_PATHOutput directory
FONT_SIZEFont size
ASSET_DIR_PATHThe material storage path
THUMBNAIL_SIZEDefault Output Size (1280×720)

Example show

Input:

python yt_thumb_gen.py --topic "Stop Procrastinating in 7 Days"

Output:

  • The background is a vision related to “self-discipline and time”;
  • The main character is automatically cut out and placed in the center;
  • The headline “STOP PROCRASTINATING” is automatically centered and shaded;
  • Export as a cover file that can be uploaded directly.

FAQs

Q1: Prompt not found llm/llama.py
→ You need to customize the file to encapsulate your own LLM calls.

Q2: Failed to cut / rembg error
→ Try to install onnxruntime or update rembg the version.

Q3: The picture has not been saved
→ Check THUMBNAIL_PATH if the path exists or has write permissions.

Open source license

This project is based on the MIT License open source,
You can freely modify, redevelop, or integrate into your own automation tools.

Special thanks to the support of open source projects such as Stable Diffusion, rembg, Gradio, etc.

My thoughts

The idea of this project is not complicated, but very practical.
It integrates the three steps of idea generation, image generation, and image processing into a single workflow.

For content creators, it doesn’t solve the problem of “generating images”,
It is the “friction” between inspiration and finished product.

In the future, if you can add a template system, font adaptation and multi-version A/B export,
It will become a complete “cover auto factory”.

Github:https://github.com/Likhithsai2580/yt_thumbnail_creator

Tubing:

Scroll to Top