๐ 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
https://github.com/user-attachments/assets/ecf82a70-5767-43b7-a371-bf115cc92908
Related Projects
- MuAPI image-editing playground โ turn portrait references into new styles and scenes
- MuAPI model catalog โ compare image-generation models
๐ Project Details
GitHub Repository: github.com/SamurAIGPT/ai-royal-portrait
Live Demo Preview: ai-royal-portrait.vercel.app

โจ 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
| Category | Styles |
|---|---|
| ๐ Hair | Voluminous Frizzy Hair, Platinum Blonde Hair, Deep Burgundy Hair, Jet Black Hair, Bold Hair Highlights |
| ๐ Makeup | Bold Red Lipstick, Smokey Eye Makeup, Glossy Nude Makeup, Winged Eyeliner, Party Glam Makeup |
| ๐ถ๏ธ Accessories | Aviator Sunglasses, Oversized Sunglasses, Modern Transparent Glasses, Bold Fashion Hat |
| ๐ Outfit | Bright Pink Outfit, Black Leather Jacket, White Formal Shirt, Neon Green Hoodie |
| ๐ฌ Lighting | Cinematic Lighting, Cyberpunk Lighting |
๐ณ Credit Pricing
| Pack | Credits | Portraits | Price |
|---|---|---|---|
| Basic | 1,000 | ~500 | $5 |
| Standard | 2,000 | ~1,000 | $10 |
| Pro | 4,000 | ~2,000 | $20 |
| Business | 10,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:
โ๏ธ 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.
- Pull existing schema:
npx prisma db pull - Add the
RoyalPortraitCreationmodel toschema.prisma - Push changes:
npx prisma db push - Cleanup: Remove other apps' models from
schema.prisma, keep onlyAccount,Session,User,VerificationToken,RoyalPortraitCreation - Generate client:
npx prisma generate
๐ป Local Development
npm install
npm run dev
๐๏ธ 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