๐งน ClearMark AI
June 29, 2026 ยท View on GitHub
Remove watermarks, logos, stamps, and text overlays from images in seconds with AI. A production-ready, self-hostable Next.js SaaS boilerplate built for photographers, designers, and content creators โ powered by GPT Image 2 via the MuAPI inference layer. A free open-source alternative to Watermarkremover.io, HitPaw, and Inpaint.
Tech stack: Next.js 14 (App Router) ยท Prisma ยท PostgreSQL ยท NextAuth (Google OAuth) ยท Stripe ยท Tailwind CSS ยท MuAPI GPT-Image-2 ยท Webhook-backed async delivery Use cases: Stock photo cleanup ยท Product image cleaning ยท Old photo restoration ยท Document digitization ยท Photography agencies ยท Content creator tools ยท E-commerce listing photos ยท Print-ready image prep

https://github.com/user-attachments/assets/0e9019c8-9a72-4d7e-8893-a45218dbeb52
๐ Project Details
GitHub Repository: github.com/SamurAIGPT/clearmark-ai
Live Demo: clearmark-ai.vercel.app
ClearMark AI is a production-ready AI web application that removes watermarks, restores old photos, and cleans documents using the gpt-image-2-image-to-image model. Users upload a single image, select a processing scenario, customize the AI prompt, and receive a clean, high-resolution result.
โจ Core Features
๐งน AI Watermark Studio (Main Page /)
- Upload any image via file picker or drag-and-drop
- 3 Scenario Quick-Select Presets with pre-filled prompts:
- ๐ผ๏ธ Remove Watermark โ removes logos, copyright text, and overlays via contextual in-painting
- ๐ธ Restore Old Photo โ fixes scratches, fading, tears, and stamps on vintage photographs
- ๐ Clean Document โ removes stamps, annotations, and overlays from scanned receipts and certificates
- Editable AI prompt for custom instructions
- Advanced options: Aspect Ratio, Resolution (1K/2K/4K), Quality (low/medium/high)
- Before/After comparison toggle in the result panel
- Cost: 18 credits per AI generation
๐ผ๏ธ Personal Gallery (/gallery)
- Responsive CSS grid of all watermark-removed images
- Thumbnail overlay showing the original input for reference
- Full-screen detail modal with Before/After toggle, HD download, and delete
- Auto-refresh every 4 seconds for in-progress jobs
๐ณ Stripe Credit Billing (/pricing)
- Four one-time credit packs (no subscriptions):
- 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)
๐ Google Auth + Credit Persistence
- NextAuth Google provider with Prisma adapter
- Credits displayed live in the Navbar with a pulsing coin icon
โก Deployment: Vercel & Production
Live App: clearmark-ai.vercel.app
๐ Required Environment Variables
| Service | Variable | Description |
|---|---|---|
| Database | DATABASE_URL | PostgreSQL connection string (Supabase or Neon) |
| NextAuth | NEXTAUTH_SECRET | Secure random string via openssl rand -base64 32 |
NEXTAUTH_URL | Your production domain | |
WEBHOOK_URL | Public URL for MuAPI async callbacks | |
| Google OAuth | GOOGLE_CLIENT_ID | Google Cloud Console |
GOOGLE_CLIENT_SECRET | Google Cloud Console | |
| Stripe | STRIPE_SECRET_KEY | Stripe Dashboard |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Stripe Dashboard | |
STRIPE_WEBHOOK_SECRET | Webhook signing secret | |
| AI | MUAPIAPP_API_KEY | Get from muapi.ai |
๐ Vercel Deployment Steps
- Database: Create a PostgreSQL instance (Supabase or Neon). Get the
DATABASE_URL. - Import: Fork and import the repo into Vercel dashboard.
- Environment Variables: Add all variables above in Vercel project settings.
- Deploy: Vercel runs
prisma generate && next buildautomatically. - Schema Push: Run
npx prisma db pushto sync tables. - Integrations:
- Google OAuth: Enable callback
https://your-app.vercel.app/api/auth/callback/google - Stripe Webhook: Point to
https://your-app.vercel.app/api/stripe/webhook - MuAPI Webhook: Point to
https://your-app.vercel.app/api/webhook/muapi
- Google OAuth: Enable callback
๐ ๏ธ Local Development
Prerequisites
- Node.js v18+
- PostgreSQL connection URL (Supabase free tier works)
- ngrok (optional, for local webhook testing)
Setup
# 1. Clone
git clone https://github.com/SamurAIGPT/clearmark-ai
cd clearmark-ai
# 2. Install dependencies
npm install
# 3. Setup environment
cp .env.example .env
# Fill in your keys
# 4. Initialize database
npx prisma generate
npx prisma db push
# 5. Start dev server
npm run dev
Webhook Tip: Run
ngrok http 3000locally and setWEBHOOK_URLto the ngrok HTTPS URL.
โ ๏ธ Database Safety Warning (Shared Pool)
The database is shared across multiple applications. Running npx prisma db push on a clean schema will drop other apps' tables. Always follow the Pull-Declare-Push-Cleanup sequence:
npx prisma db pullโ Introspect all existing tables intoschema.prisma- Add your
WatermarkRemovalmodel and itsUserrelation npx prisma db push --accept-data-lossโ Safely add new tables only- Clean
schema.prismato keep onlyAccount,Session,User,VerificationToken,WatermarkRemoval npx prisma generateโ Rebuild the type-safe Prisma client
๐๏ธ Technical Architecture
clearmark-ai/
โโโ prisma.config.ts # Dynamic datasource for Prisma v7
โโโ prisma/
โ โโโ schema.prisma # WatermarkRemoval model + NextAuth tables
โโโ src/
โ โโโ app/
โ โ โโโ page.js # AI Studio workspace (upload, scenario, prompt, result)
โ โ โโโ gallery/page.js # Personal gallery with before/after modal
โ โ โโโ pricing/page.js # 4-plan credit pricing grid
โ โ โโโ api/
โ โ โโโ auth/ # NextAuth handler
โ โ โโโ upload/ # MuAPI CDN upload proxy
โ โ โโโ generation/ # Credit deduction + gpt-image-2-image-to-image trigger
โ โ โโโ creations/ # GET / DELETE with self-healing polling
โ โ โโโ download/ # Server-side CORS-bypass download proxy
โ โ โโโ webhook/muapi/ # Async MuAPI callback handler
โ โ โโโ stripe/ # Checkout + webhook
โ โโโ components/
โ โ โโโ Providers.jsx # NextAuth SessionProvider
โ โ โโโ layout/Navbar.jsx # Sticky header with hamburger, credits, Vercel deploy
โ โโโ lib/
โ โโโ auth.js # NextAuth config
โ โโโ config.js # API keys, credit cost (18), plans
โ โโโ prisma.js # Cached Prisma singleton
โ โโโ stripe.js # Stripe instance
โ โโโ services/
โ โโโ user.js # Credit management
โ โโโ billing.js # Stripe checkout + webhook handler
โโโ next.config.mjs # Image remote patterns
๐ License
MIT Licensed.
ClearMark AI: A premium, dark-themed AI watermark removal SaaS built with the Inter font family and GPT Image 2.