Skip to content

Turn any YouTube video or uploaded video into a comic strip using AI! 🎨 Transform your favorite moments into shareable comic art with just a few clicks.

Notifications You must be signed in to change notification settings

SannidhyaDas/Comic-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

app_img_1 app_img_1

Turn any YouTube video or uploaded video into a comic strip using AI! 🎨 Transform your favorite moments into shareable comic art with just a few clicks.


🌟 Features

  • Convert Videos to Comics: Turn YouTube videos or uploaded videos into 4-panel comic strips
  • AI-Powered: Uses advanced AI models (OpenAI + Google Imagen) to generate high-quality comics
  • Natural Language Prompts: Describe your comic in plain English
  • Dual AI Engine: Primary and fallback AI models for maximum reliability
  • Professional Quality: High-resolution 1024Γ—1024 comic strips
  • Easy to Use: Simple web interface with Streamlit
  • Free & Open Source: No cost for setup and deployment

πŸŽ₯ Demo

Input Video

Sample Video

Generated Comic

Sample Comic

πŸ”§ How It Works

  1. Video Analysis: Uses Gemini AI to analyze video content and context
  2. Prompt Enhancement: Transforms user descriptions into detailed AI prompts
  3. Comic Generation: Generates comics using OpenAI's gpt-image-1 or Google's Imagen
  4. Fallback System: Automatic fallback to secondary AI if primary fails
  5. Web Interface: Streamlit-based UI for easy interaction

πŸš€ Getting Started

1️⃣ Prerequisites

  • Python 3.8+
  • YouTube video URL or video file
  • API keys (see below)

2️⃣ Installation

Clone the repository

git clone https://github.com/SannidhyaDas/Comic-AI.git
cd Comic-AI

Create virtual environment (recommended)

python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

Install dependencies

pip install -r requirements.txt

3️⃣ Configuration

  1. Create a .env file in the project root:
GEMINI_API_KEY=your_gemini_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
  1. Get your API keys:

4️⃣ Running the App

Run the Streamlit app

streamlit run app2.py

Open your browser to http://localhost:8501

πŸ› οΈ Technical Architecture

---
config:
  look: neo
  layout: fixed
---
flowchart LR
    A["User Input"] --> B("YouTube Video URL + Comic Description")
    B --> C{"Video Analysis"}
    C -- Gemini API --> D("Prompt Enhancement")
    D --> E{"Comic Generation"}
    E -- "Primary: OpenAI gpt-image-1" --> F["Comic Strip"]
    E -- Fallback: Google Imagen --> F
    F --> G["Streamlit Web Interface"]
    G --> H["User Output"]

Loading

πŸ“¦ Project Structure

Comic-AI/
β”‚
β”œβ”€β”€ assets/                        # Streamlit web interface
β”‚   β”œβ”€β”€ appInterface_1.png            # Yt video & prompt example 
β”‚   β”œβ”€β”€ appInterface_2.png            # generated comic example 
β”‚   └── generated_img1.png            # comic example 
β”‚
β”œβ”€β”€ v1/             # Gemini free image gen model
β”‚   β”œβ”€β”€ requirements.txt            # Python dependencies
β”‚   β”œβ”€β”€ main.py             # Core logic and LLM pipelines  
β”‚   β”œβ”€β”€ example1.ipynb      # example with functions of main.py 
β”‚   └── app.py              # Streamlit user interface
β”‚
β”œβ”€β”€ v2/              # paid models(OpenAI + Gemini Imagen) 
β”‚   β”œβ”€β”€ requirements.txt            # Python dependencies
β”‚   β”œβ”€β”€ main2.py             # Core logic and LLM pipelines
β”‚   β”œβ”€β”€ example2.ipynb      # example with functions of main2.py 
β”‚   └── app2.py              # Streamlit user interface
β”‚
└── README.md                   # Project documentation

πŸ“Œ Version Information

This repository contains two versions of the application:

v1: Free Tier Implementation

  • Uses gemini-2.0-flash-preview-image-generation (free image generation model)
  • Limitations:
    • Text rendering quality is inconsistent
    • Image quality can be suboptimal
    • Text in speech bubbles may appear blurry or garbled

v2: Premium Implementation

  • Implements a fallback strategy using paid models:
    • Primary: OpenAI's gpt-image-1 (superior text rendering)
    • Fallback: Google's imagen-4.0-generate-001 (high-quality image generation)
  • Benefits:
    • Significantly improved text clarity
    • Higher overall image quality
    • More reliable comic generation

The deployed version uses v1 due to the payment requirements of the premium models. However, the v2 code is fully functional - users only need to provide their own API keys and have active billing with the respective services to use the premium models.


πŸ“¬ Contact

Sannidhya Das - @LinkedIn - dassannidhya003@gmail.com

Project Link: https://github.com/SannidhyaDas/Comic-AI

About

Turn any YouTube video or uploaded video into a comic strip using AI! 🎨 Transform your favorite moments into shareable comic art with just a few clicks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published