# How to Vibe Code Your Own Lensa (and Stop Paying for It)

> AI photo & video editor and avatar generator

- Site: https://lensa.app
- Category: Photo & Video
- Platforms: iOS app, Android app, macOS app
- Verdict: **Serious undertaking** (42/100 vibecodeable)
- Estimated effort: 4-6 weeks of part-time development

## Verdict

Build a web-based proof-of-concept wrapper around an open-source image generation API, but keep paying for the mobile app if you want native performance and polished camera pipelines.

Replicating Lensa's core value as a personal tool means building a cross-platform mobile app that interfaces with a GPU backend to run Stable Diffusion fine-tuning and image segmentation models. While you can stitch together React Native, fal.ai, and Expo in a few weeks, handling the asynchronous queue for Magic Avatars, mobile touch-gesture performance, and managing API costs requires real engineering grit. It's a serious undertaking that will consume weeks of frustrating debugging.

### What you can't replicate

- Lensa's viral user acquisition loops and celebrity endorsements
- The massive proprietary dataset of fine-tuned portrait models and specialized weights
- App Store featured placement and frictionless mobile billing integration

## What it does

Lensa is a mobile-first photo and video editing application powered by artificial intelligence, offering one-tap face retouching, background removal, and a viral AI headshot/avatar generator ('Magic Avatars').

### Core features

- One-tap face and skin retouching (blemish removal, wrinkle smoothing)
- Object and background removal/replacement
- Background blurring and bokeh lighting effects
- Trendy photo and video filters (film, grain, VHS)
- AI headshot and avatar generator ('Magic Avatars') using Stable Diffusion / LoRA fine-tuning
- Native mobile app interface with gesture-based crop/adjust controls

## The business

### Pricing

- Free Tier: Free — Restricted daily photo edits and watermarked video exports.
- Pro Subscription: $4.99 - $7.99 / mo — Unlimited photo/video tools and discounts on magic avatars.
- Magic Avatars Packs: $3.99 - $15.99 — Microtransactions for generating customized AI portrait packs.

Founded 2016.
Team size: ~85-100+.

## The hard parts

- Running GPU-intensive LoRA fine-tuning and Stable Diffusion generation pipelines asynchronously without blowing up cloud compute costs
- Optimizing native mobile graphics rendering (Metal/OpenGL) for instantaneous preview filters
- Managing complex push notification queues and status updates for long-running batch avatar generations
- Building reliable content moderation layers to filter out inappropriate image outputs

## How to vibe code Lensa

### Prerequisites

- Node.js (free): Required for running the Expo and backend JavaScript/TypeScript toolchain.
- Expo Account (free): Required for building and testing the React Native mobile app on physical devices.
- GitHub (free): Source control and CI/CD pipelines.

### Recommended AI tools

- Claude Code: Best-in-class terminal agent for scaffolding the React Native app structure and backend worker logic.
- Cursor: Ideal for fine-tuning UI screens, retouching sliders, and handling mobile layout components.

### Stack

- Frontend: React Native with Expo Router
- Backend: Node.js / Express worker service
- Database: Turso (SQLite at the edge)
- Auth: better-auth
- Payments: RevenueCat
- Other: fal.ai (Flux & image generation APIs), Cloudflare R2 (Avatar and photo storage), PostHog (Product analytics)

### Hosting

- Railway (Hosting the backend processing API and queue workers that interface with AI model providers.): ~$5/mo
- Cloudflare (R2 storage for user uploads and generated avatar assets with zero egress fees.): $0-5/mo

### Build guide

1. **Project Scaffolding & Mobile Shell** — Initialize a React Native app using Expo Router with file-based navigation, setting up standard tabs for editing, magic avatars, and user account management.

```
Initialize a new Expo React Native project using TypeScript and Expo Router. Set up a bottom tab navigation bar with three primary tabs: 'Editor', 'Magic Avatars', and 'Profile'. Configure safe area views, a dark-mode theme by default, and install lucide-react-native for icons. Ensure the folder structure separates components, hooks, services, and app screens cleanly. Write a smoke test or basic screen render test to verify the setup.
```

2. **Photo Picker & Basic Local Editor UI** — Implement image picking from the device library, canvas preview area, and filter parameter sliders for contrast, saturation, and blur effects.

```
Implement an image picker screen using expo-image-picker that allows users to select a photo from their camera roll. Display the selected image inside a scrollable, zoomable canvas component using react-native-reanimated and gesture-handler. Add a bottom drawer with horizontal sliders for adjustment parameters: brightness, contrast, saturation, and background blur intensity. Store the adjustment state locally in React context and display immediate feedback on the canvas state.
```

3. **Backend API & Cloud Storage Integration** — Build an Express backend service connected to Turso and Cloudflare R2 to handle image uploads and store editing sessions.

```
Create a Node.js and Express backend service connected to Turso (SQLite) via libSQL. Set up an endpoint for uploading user photos via multipart/form-data directly to Cloudflare R2 using AWS SDK S3 compatibility. Store image metadata, user IDs, and timestamps in a 'photos' table. Implement proper error handling, upload size limits (10MB), and return signed URLs for frontend display.
```

4. **AI Magic Avatars Pipeline Integration** — Integrate fal.ai APIs on the backend to accept a batch of selfie uploads, trigger generation tasks, and manage asynchronous status updates.

```
Build an asynchronous backend job queue using Express and Redis (or Upstash) that accepts a batch of 10-20 user selfies from the mobile app, uploads them to secure storage, and initiates an avatar generation pipeline via fal.ai. Create database tables for 'avatar_jobs' tracking status ('pending', 'processing', 'completed', 'failed'). Implement webhook endpoints to receive completion callbacks from fal.ai, update job status, and notify the user when their custom digital avatars are ready for download.
```

5. **Avatar Gallery & Result Display Screen** — Build a masonry grid view in the mobile app to display generated avatars with download and share actions.

```
Create a React Native screen for the 'Magic Avatars' feature that polls the backend or listens to job statuses. When a job is completed, fetch and render the generated avatar images in a responsive grid layout using a masonry list component. Add a detail modal when tapping an individual avatar with options to save to the device photo library using expo-media-library or share via the native share sheet.
```

6. **Subscription & In-App Purchase Stubbing** — Integrate RevenueCat SDK into the mobile app to handle subscription checks, feature gating, and paywall popups.

```
Integrate RevenueCat into the Expo React Native app to manage subscription entitlements for Pro features and Magic Avatar packs. Create a reusable Paywall modal component that displays subscription tiers, feature comparison lists, and purchase action buttons. Gate advanced filters and avatar creation behind active entitlement checks, gracefully falling back to free-tier restrictions when entitlements are missing.
```

### Cost vs paying

**Starting costs (one-time):**

- Apple Developer Account (if deploying to real iOS device/TestFlight): $99/yr
- Initial fal.ai / OpenAI API generation credits: $10 one-time
- Total: ~$109 one-time

**Ongoing costs (monthly):**

- Railway Backend Hosting: $5/mo
- fal.ai / AI Generation API Usage: ~$10/mo
- Total: ~$15/mo

- Paying for the SaaS instead: $7.99 / mo
- Build time: 35-50 hours
- AI tool credits: $20 (Claude Pro)
- Break-even: 2 months

## Sources

- [Prisma Labs Official About Page](https://prisma-ai.com)
- [Wikipedia: Prisma Labs](https://en.wikipedia.org/wiki/Prisma_Labs)
- [Business Insider: Testing Lensa Magic Avatars](https://www.businessinsider.com)