๐ญ 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
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.

โจ 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) orwan2.7-image-edit-pro(with reference image). - GPT-Image-2 โ
gpt-image-2-text-to-image(text-only) orgpt-image-2-image-to-image(with image). - Nano Banana 2 โ
nano-banana-2(text-only) ornano-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.
๐๏ธ Gallery (/gallery)
- 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.
๐ Required Environment Variables
To successfully deploy and run, populate the following environment variables in your Vercel project settings:
| Service | Variable | Description & Source |
|---|---|---|
| Database | DATABASE_URL | PostgreSQL connection string (Supabase or Neon) |
DIRECT_URL | Direct DB connection for Prisma migrations | |
| NextAuth / Google | NEXTAUTH_SECRET | Secure random string generated via openssl rand -base64 32 |
NEXTAUTH_URL | Your production domain (e.g. https://my-app.vercel.app) | |
GOOGLE_CLIENT_ID | Get from Google Cloud Console | |
GOOGLE_CLIENT_SECRET | Get from Google Cloud Console | |
| Stripe Billing | STRIPE_SECRET_KEY | Get from Stripe Dashboard |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Get from Stripe Dashboard | |
STRIPE_WEBHOOK_SECRET | Webhook secret for resolving credit purchases | |
| AI Generator | MUAPIAPP_API_KEY | Create an account and get key from muapi.ai/access-keys |
๐ Launching on Vercel: Step-by-Step
- Database Provisioning: Create a new Postgres database (via free tiers on Vercel Postgres, Supabase, or Neon). Retrieve the connection strings.
- Project Creation: Import your GitHub fork into the Vercel dashboard.
- Configure Environment Variables: Copy the variables above into the Vercel project settings environment tab.
- Deploy: Hit "Deploy". Vercel will automatically run the build steps (
npm run build). - Database Push: Run
npx prisma db pushto generate the client and synchronize database models before launching. - Stripe Webhook: Register your Vercel deployment URL as a Stripe webhook endpoint (
/api/stripe/webhook) and setSTRIPE_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
| Model | Endpoint | Notes |
|---|---|---|
| Veo 3.1 | veo3.1-image-to-video | Requires image URL; 720p/1080p/4K; 8s |
| Gemini Omni | gemini-omni-image-to-video | Rich motion from text + image |
| Wan 2.7 Video | wan2.7-text-to-video | Text-only video generation |
Image Models
| Model | Text-Only Endpoint | With Image Endpoint |
|---|---|---|
| Wan 2.7 | wan2.7-text-to-image-pro | wan2.7-image-edit-pro |
| GPT-Image-2 | gpt-image-2-text-to-image | gpt-image-2-image-to-image |
| Nano Banana 2 | nano-banana-2 | nano-banana-2-edit |
๐ Related Templates
Check out other open-source SaaS templates from the same ecosystem:
| Template | Description | GitHub |
|---|---|---|
| Resale Photo Enhancer | AI product photography for resellers | github.com/SamurAIGPT/resale-photo-enhancer |
| Pet Product Studio | AI photography for pet products | github.com/SamurAIGPT/pet-product-studio |
| Old Photo Restore | Restore & colorize vintage photos | github.com/SamurAIGPT/old-photo-restore |
| Nano Banana Generator | Multi-model AI image platform | github.com/SamurAIGPT/nano-banana-generator |
๐ License
MIT Licensed. Fork it, brand it, and start earning.