๐ŸŽญ AI Meme Studio

June 29, 2026 ยท View on GitHub

Generate viral memes and short AI videos in seconds with Veo 3.1, Gemini Omni, Wan2.7, GPT-Image-2, and Nano Banana 2. A production-ready, self-hostable Next.js SaaS boilerplate with smart multi-model routing โ€” purpose-built for creators, marketers, social media managers, and brand teams. Powered by the MuAPI AI engine.

Tech stack: Next.js 14 (App Router) ยท Prisma ยท PostgreSQL ยท NextAuth (Google OAuth) ยท Stripe ยท Tailwind CSS ยท Multi-model routing ยท MuAPI Use cases: TikTok meme videos ยท Instagram Reels ยท YouTube Shorts ยท Twitter/X virality ยท Brand meme marketing ยท UGC short-form content ยท Discord stickers ยท Reddit posts ยท Social media campaigns

Awesome Generative AI Apps

๐ŸŽจ Explore 50+ more open-source AI apps โ†’

https://github.com/user-attachments/assets/7b60581d-356f-4eb6-9564-7540460b527b

๐ŸŒ Project Repository

GitHub Repository: github.com/SamurAIGPT/ai-meme-generator

Live Demo: ai-meme-umber.vercel.app

Sign in with Google to explore the video generation studio, image meme creator, gallery archive, and credit purchase flows.


AI Meme Studio is a production-ready, highly-optimized AI web application. Out of the box, it seamlessly manages User Authentication, Credits & Billing, Creation Persistence, and asynchronous AI generation polling using a sleek Next.js (App Router) architecture. It empowers creators, marketers, and brands to generate viral-ready memes and short-form AI videos in seconds.

Why use AI Meme Studio?

  • Production-Ready SaaS โ€” Complete with Google OAuth and Stripe Checkout workflows built-in.
  • Multi-Model AI Engine โ€” Supports Veo 3.1, Gemini Omni, Wan2.7, GPT-Image-2, and Nano Banana 2 models.
  • Smart Model Routing โ€” Automatically uses text-to-image/video models when no image is uploaded, and image-editing models when a reference image is provided.
  • Historical Gallery โ€” All creations (images and videos) are securely persisted to a PostgreSQL database for a custom user workspace.
  • Responsive & Polished UX โ€” Clean dark/light theme interface with smooth transitions and a premium feel on both desktop and mobile.
  • Extensible API โ€” Easily swap or adapt underlying model endpoints without breaking layout styling.

AI Meme Studio

โœจ Core Features

๐ŸŽฌ Video Generation (Homepage)

  • Veo 3.1 Image-to-Video โ€” Turn any image into a cinematic short clip. Supports 16:9 / 9:16 aspect ratios, 720p / 1080p / 4K resolution, and 8-second duration.
  • Gemini Omni Image-to-Video โ€” Google's flagship model for expressive motion generation from a reference image.
  • Wan2.7 Text-to-Video โ€” Pure text-driven video generation, no image required.
  • Real-time Polling โ€” Generation jobs are tracked asynchronously with live status updates and a progress indicator.

๐Ÿ–ผ๏ธ Image Generation (/image)

  • Wan 2.7 โ€” wan2.7-text-to-image-pro (text-only) or wan2.7-image-edit-pro (with reference image).
  • GPT-Image-2 โ€” gpt-image-2-text-to-image (text-only) or gpt-image-2-image-to-image (with image).
  • Nano Banana 2 โ€” nano-banana-2 (text-only) or nano-banana-2-edit (with image).
  • Supports multiple aspect ratios: 1:1, 4:3, 3:4, 16:9, 9:16, 21:9, 9:21, 3:2, 2:3.
  • Full creation archive for authenticated users โ€” images and videos side by side.
  • 1-click download and delete for each creation.
  • Secure database-backed persistence using Prisma + PostgreSQL.

๐Ÿ’ณ Credit Billing (/pricing)

  • Standard Pack โ€” 100 credits for $5.
  • Pro Pack โ€” 250 credits for $10.
  • Stripe Checkout integration โ€” payments go straight to your Stripe account.

โšก Deployment: Vercel & Production

This architecture is engineered explicitly for Vercel serverless environments.

Deploy with Vercel

๐Ÿ”‘ Required Environment Variables

To successfully deploy and run, populate the following environment variables in your Vercel project settings:

ServiceVariableDescription & Source
DatabaseDATABASE_URLPostgreSQL connection string (Supabase or Neon)
DIRECT_URLDirect DB connection for Prisma migrations
NextAuth / GoogleNEXTAUTH_SECRETSecure random string generated via openssl rand -base64 32
NEXTAUTH_URLYour production domain (e.g. https://my-app.vercel.app)
GOOGLE_CLIENT_IDGet from Google Cloud Console
GOOGLE_CLIENT_SECRETGet from Google Cloud Console
Stripe BillingSTRIPE_SECRET_KEYGet from Stripe Dashboard
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYGet from Stripe Dashboard
STRIPE_WEBHOOK_SECRETWebhook secret for resolving credit purchases
AI GeneratorMUAPIAPP_API_KEYCreate an account and get key from muapi.ai/access-keys

๐Ÿš€ Launching on Vercel: Step-by-Step

  1. Database Provisioning: Create a new Postgres database (via free tiers on Vercel Postgres, Supabase, or Neon). Retrieve the connection strings.
  2. Project Creation: Import your GitHub fork into the Vercel dashboard.
  3. Configure Environment Variables: Copy the variables above into the Vercel project settings environment tab.
  4. Deploy: Hit "Deploy". Vercel will automatically run the build steps (npm run build).
  5. Database Push: Run npx prisma db push to generate the client and synchronize database models before launching.
  6. Stripe Webhook: Register your Vercel deployment URL as a Stripe webhook endpoint (/api/stripe/webhook) and set STRIPE_WEBHOOK_SECRET.

๐Ÿ› ๏ธ Local Development

Prerequisites

  • Node.js (v18 or higher)
  • A local/cloud PostgreSQL instance.

Setup

# 1. Clone the repository
git clone https://github.com/SamurAIGPT/ai-meme
cd ai-meme

# 2. Install dependencies
npm install

# 3. Setup Environment
cp .env.example .env
# Open .env and insert your specific keys.

# 4. Initialize Database Schema
npx prisma generate
npx prisma db push

# 5. Start the Development Server
npm run dev

The console should now be active on http://localhost:3000.


๐Ÿ—๏ธ Technical Architecture

ai-meme/
โ”œโ”€โ”€ prisma/
โ”‚   โ””โ”€โ”€ schema.prisma           # Postgres tables: Users, Accounts, Sessions, Creations
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                    # Next.js App Router
โ”‚   โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth/           # NextAuth Google OAuth handler
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ generate/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ video/      # Video generation endpoint (Veo, Gemini Omni, Wan2.7)
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ image/      # Image generation endpoint (Wan2.7, GPT-Image-2, Nano Banana)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ creations/      # GET all creations + polling; DELETE by ID
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ upload/         # Proxy file upload to MuAPI CDN
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ stripe/         # Checkout session + webhook handler
โ”‚   โ”‚   โ”œโ”€โ”€ image/              # Image Generation page (/image)
โ”‚   โ”‚   โ”œโ”€โ”€ gallery/            # Creations Gallery page (/gallery)
โ”‚   โ”‚   โ”œโ”€โ”€ pricing/            # Credit Tiers & Stripe Checkout (/pricing)
โ”‚   โ”‚   โ””โ”€โ”€ page.js             # Main Video Generation Studio (/)
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ layout/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Navbar.jsx      # Sticky top nav with credits, auth, Deploy button
โ”‚   โ”‚   โ””โ”€โ”€ Providers.jsx       # NextAuth SessionProvider wrapper
โ”‚   โ””โ”€โ”€ lib/
โ”‚       โ”œโ”€โ”€ prisma.js            # Shared PrismaClient singleton (pg adapter)
โ”‚       โ”œโ”€โ”€ auth.js              # NextAuth config (Google provider + Prisma adapter)
โ”‚       โ”œโ”€โ”€ config.js            # App config: plans, model lists, API base URL
โ”‚       โ”œโ”€โ”€ stripe.js            # Stripe client singleton
โ”‚       โ””โ”€โ”€ services/
โ”‚           โ”œโ”€โ”€ user.js          # User credit reads/writes
โ”‚           โ”œโ”€โ”€ billing.js       # Stripe webhook credit fulfillment
โ”‚           โ””โ”€โ”€ ai.js            # MuAPI request helpers for video & image
โ””โ”€โ”€ next.config.mjs              # Next.js configuration

๐Ÿค– AI Models Reference

Video Models

ModelEndpointNotes
Veo 3.1veo3.1-image-to-videoRequires image URL; 720p/1080p/4K; 8s
Gemini Omnigemini-omni-image-to-videoRich motion from text + image
Wan 2.7 Videowan2.7-text-to-videoText-only video generation

Image Models

ModelText-Only EndpointWith Image Endpoint
Wan 2.7wan2.7-text-to-image-prowan2.7-image-edit-pro
GPT-Image-2gpt-image-2-text-to-imagegpt-image-2-image-to-image
Nano Banana 2nano-banana-2nano-banana-2-edit

Check out other open-source SaaS templates from the same ecosystem:

TemplateDescriptionGitHub
Resale Photo EnhancerAI product photography for resellersgithub.com/SamurAIGPT/resale-photo-enhancer
Pet Product StudioAI photography for pet productsgithub.com/SamurAIGPT/pet-product-studio
Old Photo RestoreRestore & colorize vintage photosgithub.com/SamurAIGPT/old-photo-restore
Nano Banana GeneratorMulti-model AI image platformgithub.com/SamurAIGPT/nano-banana-generator

๐Ÿ“„ License

MIT Licensed. Fork it, brand it, and start earning.