๐๏ธ AI Tattoo Try-On
August 2, 2026 ยท View on GitHub
Preview any tattoo design on your body virtually before getting inked. A production-ready, self-hostable Next.js SaaS boilerplate built for tattoo studios, artists, fashion brands, and DTC apps. A free open-source alternative to Ink Hunter, Tattoosmart, and InkAR โ powered by the MuAPI AI engine.
Tech stack: Next.js 14 (App Router) ยท Prisma ยท PostgreSQL ยท NextAuth (Google OAuth) ยท Stripe ยท Tailwind CSS ยท MuAPI (nano-banana-pro-edit) ยท Webhook-backed async delivery Use cases: Tattoo parlor client consultations ยท Virtual ink placement previews ยท Personal body art planning ยท Tattoo artist portfolio marketing ยท Tattoo design communities ยท Body art e-commerce ยท Interactive try-on widgets

https://github.com/user-attachments/assets/9b347782-e043-4111-91c3-4a7c74c76875
Related Projects
- MuAPI image playground โ Try image-editing models for virtual tattoo placement.
- MuAPI specialized apps docs โ Image transformation workflows for creative tools.
๐ Project Details
GitHub Repository: github.com/SamurAIGPT/ai-tattoo-try-on
Live Demo Preview: ai-tattoo-try-on.vercel.app
AI Tattoo Try-On is a production-ready, highly-optimized AI web application. Out of the box, it seamlessly manages User Authentication, Credits & Billing, Image Persistence, and asynchronous tattoo generation using a sleek Next.js (App Router) architecture. It empowers users, studios, and artists to render custom tattoo art realistically onto body shapes โ all without permanent ink.
Why use AI Tattoo Try-On?
- Production-Ready SaaS โ Complete with Google OAuth and Stripe Checkout workflows built-in.
- Virtual Try-On Studio โ Upload body portraits and tattoo design images, select placements, choose custom prompts, and see results instantly.
- Webhook-Backed AI Delivery โ MuAPI async webhook delivers results directly into the database (
/api/webhook/muapi), keeping API routes non-blocking and preventing request timeouts. - Personal Showroom Gallery โ All generated try-ons are saved to PostgreSQL. Users can review, compare, download, and delete their designs from
/gallery. - Responsive Screen-Fitting โ Designed with a fluid layout that fits perfectly on all screens (mobile, tablet, desktop) using stacked adaptive grids on mobile and viewport-locked scrolling on desktop.
โจ Core Features
๐จ Virtual Try-On Studio (Main Page /)
- Dual image uploads via file picker or drag-and-drop: one for the body/person photo, and another for the tattoo design.
- Predefined parameters via Custom Select Dropdowns for target body placement presets.
- Customizable prompt styling with an Optimize Ink Shading & Blending sliding toggle switch to maintain skin realism.
- Cost: 24 credits per AI Tattoo simulation.
๐ผ๏ธ Personal Showroom Gallery (/gallery)
- Visual card grid of all generated tattoo simulations.
- Cards show a thumbnail, placement used, prompt summary, creation date, and status (
processing/completed/failed). - Full-screen viewer modal with a floating overlay of the input photos for reference, along with Download HD and Delete Result actions.
๐ณ Stripe Credit Billing (/pricing)
- Four credit packs based on a $1 = 200 credits conversion rate:
- Basic Pack ($5 / 1,000 credits)
- Standard Pack ($10 / 2,000 credits)
- Professional Pack ($20 / 4,000 credits โ Most Popular)
- Business Pack ($50 / 10,000 credits)
- No recurring subscriptions โ pay once, use at your own pace.
- Credit balance is automatically topped up via Stripe webhook on checkout completion.
๐ Google Auth + Credit Persistence
- NextAuth Google provider with Prisma adapter โ user sessions, credit balances, and galleries are all persisted per account.
- Credits displayed live in the Navbar with a pulsing coin icon.
โก Deployment: Vercel & Production
This architecture is engineered explicitly for Vercel serverless environments.
One-Click Deploy
Live App: ai-tattoo-try-on.vercel.app
๐ Required Environment Variables
To successfully deploy and run, you must populate the following environment variables in your Vercel project settings:
| Service | Variable | Description & Source |
|---|---|---|
| Database | DATABASE_URL | PostgreSQL connection string (Supabase or Neon) |
| 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) | |
WEBHOOK_URL | Public URL for MuAPI async callbacks (same as NEXTAUTH_URL in production) | |
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 Generation | MUAPIAPP_API_KEY | Create an account and get key from muapi.ai |
๐ Launching on Vercel: Step-by-Step
- Database Provisioning: Create a new Postgres database (via Supabase or Neon). Retrieve the connection string (
DATABASE_URL). - 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 synchronize database models before launching. - Integrations Setup:
- Establish a Google Cloud OAuth app, enabling the callback URL:
https://your-app.vercel.app/api/auth/callback/google - Setup a Stripe Webhook, pointing to
https://your-app.vercel.app/api/stripe/webhookand selecting thecheckout.session.completedevent. - Register a MuAPI Webhook pointing to
https://your-app.vercel.app/api/webhook/muapito receive async generation results.
- Establish a Google Cloud OAuth app, enabling the callback URL:
๐ ๏ธ Local Development
Ready to iterate locally? Setup is straightforward.
Prerequisites
- Node.js (v18 or higher)
- A local PostgreSQL instance or a free cloud Database URL.
- ngrok (optional, for local MuAPI webhook testing)
Setup
# 1. Clone the repository
git clone https://github.com/SamurAIGPT/ai-tattoo-try-on
cd ai-tattoo-try-on
# 2. Install dependencies
npm install --legacy-peer-deps
# 3. Setup Environment
cp .env.example .env
# Open .env and insert your specific keys.
# 4. Initialize Database Schema
# Note: Because the database is shared, see the Safety Warning below!
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.
Webhook Tip: For local MuAPI webhook testing, run
ngrok http 3000and setWEBHOOK_URLto the generated HTTPS URL in your.env.
โ ๏ธ Database Safety Warning (Shared Pool)
The workspace database is shared with other applications. Running npx prisma db push on a clean, empty schema will drop tables belonging to other applications. Always follow the Pull-Declare-Push-Cleanup sequence:
- Run
npx prisma db pullto fetch all database tables. - Declare your
TattooCreationtable and update the relations on theUsermodel. - Run
npx prisma db pushto add your changes safely. - Clean up
schema.prismato keep only NextAuth models,TattooCreation, and the updatedUserrelations. - Run
npx prisma generateto rebuild the type-safe client.
๐๏ธ Technical Architecture
ai-tattoo-try-on/
โโโ prisma/
โ โโโ schema.prisma # Postgres schema (User, Account, Session, TattooCreation)
โโโ src/
โ โโโ app/ # Next.js App Router
โ โ โโโ page.js # Main Studio Workspace (Uploads, Presets, Custom inputs)
โ โ โโโ gallery/ # Dedicated showroom gallery view grid
โ โ โโโ pricing/ # 4-Plan credit pricing grid (\$1 = 200 credits)
โ โ โโโ api/
โ โ โโโ auth/ # NextAuth handler
โ โ โโโ upload/ # MuAPI file upload proxy
โ โ โโโ generation/ # Credit deduction + MuAPI trigger endpoint
โ โ โโโ creations/ # GET / DELETE creations history (with webhook bypass sync)
โ โ โโโ webhook/muapi/ # MuAPI async webhook callback handler
โ โ โโโ stripe/ # Stripe checkout creation + checkout webhook
โ โโโ components/
โ โ โโโ Providers.jsx # NextAuth SessionProvider wrapper
โ โ โโโ layout/Navbar.jsx # Sticky header with Hamburger, Vercel Deploy & credit balance
โ โโโ lib/
โ โโโ auth.js # NextAuth config with Prisma adapter
โ โโโ config.js # Central config mapping Google, Stripe, MuAPI keys
โ โโโ prisma.js # Cached Prisma client singleton
โ โโโ stripe.js # Stripe instance initializer
โ โโโ services/
โ โโโ user.js # Credit management service (24 credits per run)
โ โโโ billing.js # Stripe checkout and payment webhook parser
โโโ next.config.mjs # Next.js configuration
๐ License
MIT Licensed.
AI Tattoo Try-On: A premium, high-contrast, fully responsive virtual tattoo try-on studio built for ink artists, studios, and styling creators.