๐Ÿ‘‘ Royal Portrait AI

August 2, 2026 ยท View on GitHub

Transform any selfie into 20 unique royal, cinematic, and artistic portrait styles in seconds. A production-ready, self-hostable Next.js SaaS boilerplate with HD downloads, a personal gallery dashboard, and built-in Stripe billing. A free open-source alternative to Lensa AI, Portrait AI, PicsArt AI, and Facetune โ€” powered by the MuAPI AI engine.

Tech stack: Next.js 14 (App Router) ยท Prisma ยท PostgreSQL ยท NextAuth (Google OAuth) ยท Stripe ยท Tailwind CSS ยท MuAPI portrait-stylist Use cases: Photo editing apps ยท AI selfie art ยท Profile picture generators ยท Social media content ยท Gift portraits ยท AI avatar creation ยท Personal branding ยท Dating profile photos

Awesome Generative AI Apps

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

https://github.com/user-attachments/assets/ecf82a70-5767-43b7-a371-bf115cc92908

๐ŸŒ Project Details

GitHub Repository: github.com/SamurAIGPT/ai-royal-portrait

Live Demo Preview: ai-royal-portrait.vercel.app

Deploy with Vercel

AI Royal Portrait UI

โœจ Features

  • ๐ŸŽจ 20 Unique Styles โ€” Hair, makeup, accessories, outfits & cinematic lighting
  • โšก Instant Generation โ€” AI-powered portrait transformation in seconds
  • ๐Ÿ’ฐ Just 2 Credits Per Portrait โ€” $0.01 per image (1$ = 200 credits)
  • ๐Ÿ–ผ๏ธ HD Downloads โ€” Save your portraits in full resolution
  • ๐Ÿ” Google Authentication โ€” Secure sign-in via Google OAuth
  • ๐Ÿ’ณ Credit System โ€” Buy credits with Stripe, no subscription needed
  • ๐Ÿ”„ Auto-Refresh Gallery โ€” Real-time status updates via polling + webhooks
  • ๐Ÿ“ฑ Fully Responsive โ€” Works on mobile, tablet and desktop

๐Ÿ–ผ๏ธ Styles Available

CategoryStyles
๐Ÿ’‡ HairVoluminous Frizzy Hair, Platinum Blonde Hair, Deep Burgundy Hair, Jet Black Hair, Bold Hair Highlights
๐Ÿ’„ MakeupBold Red Lipstick, Smokey Eye Makeup, Glossy Nude Makeup, Winged Eyeliner, Party Glam Makeup
๐Ÿ•ถ๏ธ AccessoriesAviator Sunglasses, Oversized Sunglasses, Modern Transparent Glasses, Bold Fashion Hat
๐Ÿ‘” OutfitBright Pink Outfit, Black Leather Jacket, White Formal Shirt, Neon Green Hoodie
๐ŸŽฌ LightingCinematic Lighting, Cyberpunk Lighting

๐Ÿ’ณ Credit Pricing

PackCreditsPortraitsPrice
Basic1,000~500$5
Standard2,000~1,000$10
Pro4,000~2,000$20
Business10,000~5,000$50

New users receive 100 free credits (50 portraits) on sign-up.

๐Ÿš€ Deploy

Click the button below to deploy your own instance to Vercel in one click:

Deploy with Vercel

โš™๏ธ Environment Variables

Create a .env file based on .env.example:

# Database (Supabase PostgreSQL)
DATABASE_URL="postgresql://postgres:[password]@db.supabase.co:5432/postgres?pgbouncer=true"
DIRECT_URL="postgresql://postgres:[password]@db.supabase.co:5432/postgres"

# NextAuth
NEXTAUTH_URL="https://your-domain.com"
NEXTAUTH_SECRET="your_secret_here"

# Google OAuth
GOOGLE_CLIENT_ID="your_google_client_id"
GOOGLE_CLIENT_SECRET="your_google_client_secret"

# MuAPI
MU_API_KEY="your_muapi_key"

# Webhook (public URL for async callbacks)
WEBHOOK_URL="https://your-domain.com"

# Stripe
STRIPE_SECRET_KEY="sk_live_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_live_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

๐Ÿ—„๏ธ Database Setup

โš ๏ธ Warning: This app shares a Supabase PostgreSQL database. Follow the Pull-Declare-Push-Cleanup sequence carefully to avoid dropping other apps' tables.

  1. Pull existing schema: npx prisma db pull
  2. Add the RoyalPortraitCreation model to schema.prisma
  3. Push changes: npx prisma db push
  4. Cleanup: Remove other apps' models from schema.prisma, keep only Account, Session, User, VerificationToken, RoyalPortraitCreation
  5. Generate client: npx prisma generate

๐Ÿ’ป Local Development

npm install
npm run dev

Open http://localhost:3000

๐Ÿ—๏ธ Technical Architecture

  • Framework: Next.js 16 (App Router)
  • AI Model: MuAPI portrait-stylist (Runware provider)
  • Auth: NextAuth.js v4 with Google OAuth + Prisma Adapter
  • Database: PostgreSQL (Supabase shared pool) via Prisma ORM
  • Payments: Stripe (one-time credit purchases)
  • Styling: Tailwind CSS v4 with royal gold dark theme
  • Generation Pipeline: POST โ†’ inline polling (18s) โ†’ webhook fallback โ†’ auto-sync on GET