LogoOld Photo AI Docs
LogoOld Photo AI Docs
HomepageOld Photo AI Guide
X (Twitter)

Old Photo AI Guide

A complete guide to Old Photo AI — the AI-powered platform for restoring and enhancing treasured old photographs in seconds.

What is Old Photo AI?

Old Photo AI is an AI-powered old photo restoration platform that lets you restore damaged, faded, scratched, or black-and-white photos in seconds. Upload your old family portraits and let AI repair the damage, enhance details, and bring your treasured memories back to life.

Tech Stack

  • AI Models: State-of-the-art generative AI for image restoration
  • Framework: Next.js App Router with TypeScript
  • Auth: Better Auth (GitHub + Google OAuth, email/password)
  • Database: PostgreSQL with Drizzle ORM
  • Payments: Stripe (subscriptions, one-time purchases, credit packages)
  • UI: Tailwind CSS + Radix UI + Lucide icons
  • i18n: next-intl (English + Chinese)
  • Email: Resend with React Email templates
  • Content: Fumadocs for documentation, MDX for blog

Quick Start

Prerequisites

  • Node.js 18+
  • pnpm (recommended)
  • PostgreSQL database

Installation

git clone https://github.com/zhangst23/old-photo-ai.git
cd old-photo-ai
pnpm install

Environment Setup

Copy the example environment file and fill in your values:

cp env.example .env.local

Key environment variables:

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/old-photo-ai

# Auth
BETTER_AUTH_SECRET=your-secret-key
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# Stripe
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...

# Email
RESEND_API_KEY=re_...

# AI (Kie API for image generation)
KIE_API_KEY=your-kie-api-key
NEXT_PUBLIC_KIE_MODEL=gpt-image-2-image-to-image

Database Setup

Generate and run migrations:

pnpm db:generate
pnpm db:migrate

Start Development

pnpm dev

Visit http://localhost:3000 to see your app.

How to Restore Photos

Upload a Photo

  1. Click on the upload area or drag and drop your old photo
  2. Supported formats: PNG, JPG, WebP (max 30MB)
  3. Your photo will be displayed as a preview

Describe Your Restoration

Enter a prompt describing how you want to restore the photo. For example:

  • "Restore colors and fix scratches"
  • "Enhance details and remove damage"
  • "Colorize this black and white photo"

Generate

Click "Restore Photo" and wait a few seconds for AI to process your image. The restored version will appear on the right side.

Download

Once satisfied, download the restored photo in your preferred format.

Key Features

AI Photo Restoration

Restore old photos with AI:

  • Fix Scratches & Damage: Remove scratches, creases, and physical damage
  • Enhance Details: Improve clarity and sharpness
  • Restore Colors: Bring faded colors back to life
  • Colorize B&W: Add realistic colors to black and white photos

Multi-format Export

  • PNG — High-quality with transparency support
  • JPG — Optimized for sharing and printing

Credit System

Flexible usage-based billing:

  • Monthly credit refresh for subscribers
  • Registration bonus credits
  • Credit packages for additional restorations
  • Usage tracking with transaction history

API Integration

Old Photo AI provides a REST API for programmatic photo restoration:

# Restore a photo
POST /api/v1/generate
{
  "prompt": "Restore this old photo, enhance details",
  "input_urls": ["https://storage.example.com/old-photo.jpg"]
}

API keys can be managed from your dashboard under Settings → API Keys.

Common Tasks

Adding a New Page

  1. Create a new file in src/app/[locale]/(marketing)/
  2. Add the route to src/routes.ts
  3. Add navigation links in src/config/navbar-config.tsx

Deploying to Production

pnpm build

The app is ready for deployment on Vercel, Docker, or any Node.js hosting platform.

Learn More

  • Configuration Guide — Customize the platform for your needs
  • API Reference — Explore available endpoints and actions

Table of Contents

What is Old Photo AI?
Tech Stack
Quick Start
Prerequisites
Installation
Environment Setup
Database Setup
Start Development
How to Restore Photos
Upload a Photo
Describe Your Restoration
Generate
Download
Key Features
AI Photo Restoration
Multi-format Export
Credit System
API Integration
Common Tasks
Adding a New Page
Deploying to Production
Learn More