✨ LinkedIn Carousel Generator
A complete application that automatically generates professional, highly visual LinkedIn carousels from simple text or articles using Google's Gemini 3 Pro (for advanced reasoning and content structuring) and Gemini 3 Image (for high-quality, style-consistent backgrounds).
Built with Python, Streamlit, and the latest Google GenAI SDK.
🚀 Features
- Automated Content Generation: Extracts key points from any text or article and structures them into a compelling multi-slide narrative optimized for LinkedIn.
- AI Image Generation: Dynamically creates unique, high-quality background images tailored to the content of each slide using Gemini's image models.
- Consistent Styling: Supports multiple visual styles or a custom user-uploaded reference image to maintain brand consistency across all slides.
- Auto-Formatting: Automatically overlays text, headlines, and code snippets onto the generated backgrounds using Python Pillow.
- Cost Estimation: Provides real-time token and cost estimation for transparency.
- Multi-Language Support: Generate carousels in over 10 different languages.
- Export Ready: Download all generated slides as a ZIP file, ready to be converted to PDF and posted directly to LinkedIn.
🛠️ Tech Stack
- Frontend: Streamlit
- AI Models: Google Gemini (via
google-genaiSDK) - Image Processing: Pillow (PIL)
- Deployment: Docker & Docker Compose
📦 Getting Started
Prerequisites
- A Google Gemini API Key. You can get one from Google AI Studio.
- Docker and Docker Compose (Recommended) or Python 3.10+ (for local development).
Option 1: Running with Docker (Recommended)
The easiest way to run the application is using Docker Compose.
-
Clone the repository (if you haven't already) and navigate to the project directory:
cd linkedin-carousel-generator -
Run the application: You can either export your API key first or pass it inline:
export GOOGLE_API_KEY="your_api_key_here" docker compose up --build -dAlternatively, you can provide the API key later through the web UI.
-
Access the app: Open your browser and navigate to http://localhost:8501.
Option 2: Local Python Setup
-
Navigate to the app directory:
cd linkedin-carousel-generator/linkedin_carousel_app -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` -
Install the dependencies:
pip install -r requirements.txt -
Run the application:
streamlit run app.py
🏗️ Project Structure
linkedin-carousel-generator/
├── Dockerfile # Container definition for the app
├── docker-compose.yml # Compose file for easy deployment
├── .dockerignore # Files to exclude from Docker builds
├── linkedin_carousel_app/ # Main application source code
│ ├── app.py # Main Streamlit UI and execution logic
│ ├── generator.py # Integration with Google Gemini for Text & Images
│ ├── styles.py # Configuration for visual styles and layouts
│ ├── utils.py # Helper functions (Image formatting, fonts, etc.)
│ └── requirements.txt # Python dependencies
└── README.md # Project documentation
💡 How to Use
- Enter API Key: Open the settings sidebar and paste your Gemini API Key if you haven't set it via environment variables.
- Paste Text: In the main area, paste the article, blog post, or ideas you want to convert into a carousel.
- Configure: Select an output language and visual style (e.g., Tech Minimalist, Bold Gradient).
- Generate: Click "Generate Carousel". The app will first break down your text into slides, and then generate imagery for each one concurrently.
- Download: Once finished, preview the slides in the app and click the download button to get a ZIP archive of your completed carousel.
(Tip: To post on LinkedIn as a swipeable carousel, convert the downloaded images into a single PDF document first).