๐Ÿงน 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

ClearMark AI Interface

Awesome Generative AI Apps

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

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
  • 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

Deploy with Vercel

Live App: clearmark-ai.vercel.app

๐Ÿ”‘ Required Environment Variables

ServiceVariableDescription
DatabaseDATABASE_URLPostgreSQL connection string (Supabase or Neon)
NextAuthNEXTAUTH_SECRETSecure random string via openssl rand -base64 32
NEXTAUTH_URLYour production domain
WEBHOOK_URLPublic URL for MuAPI async callbacks
Google OAuthGOOGLE_CLIENT_IDGoogle Cloud Console
GOOGLE_CLIENT_SECRETGoogle Cloud Console
StripeSTRIPE_SECRET_KEYStripe Dashboard
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYStripe Dashboard
STRIPE_WEBHOOK_SECRETWebhook signing secret
AIMUAPIAPP_API_KEYGet from muapi.ai

๐Ÿš€ Vercel Deployment Steps

  1. Database: Create a PostgreSQL instance (Supabase or Neon). Get the DATABASE_URL.
  2. Import: Fork and import the repo into Vercel dashboard.
  3. Environment Variables: Add all variables above in Vercel project settings.
  4. Deploy: Vercel runs prisma generate && next build automatically.
  5. Schema Push: Run npx prisma db push to sync tables.
  6. 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

๐Ÿ› ๏ธ 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 3000 locally and set WEBHOOK_URL to 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:

  1. npx prisma db pull โ€” Introspect all existing tables into schema.prisma
  2. Add your WatermarkRemoval model and its User relation
  3. npx prisma db push --accept-data-loss โ€” Safely add new tables only
  4. Clean schema.prisma to keep only Account, Session, User, VerificationToken, WatermarkRemoval
  5. 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.