Transform your old black and white photos into vibrant, modern images using AI powered by FAL AI's Flux Kontext model.
🚀 Coming Soon: Video transformation features to bring your restored photos to life!
- 📸 Easy Upload: Drag and drop or click to upload photos
- 🎨 AI-Powered Restoration: Uses Flux Kontext for high-quality photo restoration
- ⚡ Real-time Processing: See your restored photos in real-time
- 🎯 Custom Prompts: Optional custom restoration prompts for specific results
- 💾 Download Results: Download your restored photos instantly
- 🌙 Dark Mode Support: Beautiful UI that works in light and dark modes
- 📱 Responsive Design: Works perfectly on desktop and mobile devices
- Node.js 18+
- A FAL AI API key (sign up at fal.ai)
-
Clone this repository or use this as your starting template
-
Install dependencies:
npm install
-
Set up your environment variables: Create a
.env.localfile in the root directory:FAL_KEY=your_fal_ai_api_key_here
-
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser
- Visit fal.ai
- Sign up for an account
- Navigate to your API settings
- Generate a new API key
- Copy the key and add it to your
.env.localfile
-
Upload a Photo:
- Drag and drop an old black and white photo onto the upload area
- Or click the upload area to select a file from your device
-
Optional Custom Prompt:
- Add a custom restoration prompt if you want specific results
- For example: "Restore this vintage family photo with warm, natural colors and enhance the clothing details"
- Leave empty to use the default restoration prompt
-
Restore:
- Click the "Restore Photo" button
- Wait for the AI to process your image (usually takes 10-30 seconds)
-
Download:
- Once restoration is complete, download your restored photo
- Compare the before and after results side by side
- Next.js 15 - React framework with App Router
- TypeScript - Type safety and better development experience
- Tailwind CSS - Utility-first CSS framework
- FAL AI Client - Integration with Flux Kontext model
POST /api/upload- Handles file uploads to FAL storagePOST /api/restore- Processes photo restoration using Flux Kontext
- File Upload: Supports drag-and-drop and click-to-upload
- Image Processing: Uses FAL AI's Flux Kontext model for restoration
- Responsive UI: Beautiful, modern interface that works on all devices
- Error Handling: Comprehensive error handling and user feedback
- Loading States: Clear feedback during upload and processing
Create a .env.local file with the following:
# FAL AI API Key (required)
FAL_KEY=your_fal_ai_api_key_here- Push your code to GitHub
- Connect your repository to Vercel
- Add your
FAL_KEYenvironment variable in Vercel's dashboard - Deploy!
Make sure to set the FAL_KEY environment variable in your deployment platform.
You can customize the default restoration behavior by modifying the prompt in app/api/restore/route.ts:
const restorePrompt = prompt || "Your custom default prompt here";The app uses Tailwind CSS. You can customize the appearance by modifying the classes in app/components/PhotoRestorer.tsx.
You can adjust the Flux Kontext model parameters in app/api/restore/route.ts:
const result = await fal.subscribe("fal-ai/flux-pro/kontext", {
input: {
prompt: restorePrompt,
image_url: imageUrl,
guidance_scale: 3.5, // Adjust for prompt adherence
num_images: 1,
output_format: "jpeg",
safety_tolerance: "2",
},
// ... other options
});-
"Invalid src prop" error:
- Make sure you've restarted your development server after updating
next.config.ts
- Make sure you've restarted your development server after updating
-
"FAL_KEY environment variable is not set":
- Ensure you've created a
.env.localfile with your FAL AI API key - Restart your development server after adding environment variables
- Ensure you've created a
-
Upload fails:
- Check that your image file is a valid format (JPG, PNG, etc.)
- Ensure your FAL AI API key has sufficient credits
-
Restoration takes too long:
- The Flux Kontext model typically takes 10-30 seconds
- Check the browser console for any error messages
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
For issues with the app, please create an issue on GitHub. For FAL AI API issues, check the FAL AI documentation or contact their support.