HAIR AI

Role
Co-founder · backend and mobile
Company
Alamet
Platform
iOS · Android
Category
Photo · beauty
Market
Global · multilingual
01Overview

Hair AI answers the question “would this look good on me?” before you go to the hairdresser. Users upload or take a photo of themselves; the app finds the hair region automatically, and they can touch it up with a brush if they want. The chosen style and color are applied to the hair alone, leaving the face and background untouched.

Problem

Most of the time, the only way to really see a new hairstyle is to cut or dye your hair. Off-the-shelf filters distort the face and the photo, don't look realistic, and are limited to a handful of preset styles.

Solution

The hair region is masked automatically, and generative AI redraws only that region (inpainting). The desired hair is described with preset styles, a color palette or free text, and every generation returns multiple variations. Jobs run through a queue on GPU servers, with progress shown live in the app.

02How it works
  1. 01

    Upload

    The photo is uploaded to the cloud, and the user's daily generation quota is checked.

  2. 02

    Mask

    The hair region is detected automatically; the user can refine it with a brush and eraser.

  3. 03

    Prompt

    The chosen style, color or free text is turned into prompts suited to the model.

  4. 04

    Generation

    The job enters the GPU queue; the model redraws only the masked region.

  5. 05

    Result

    Variations come back to the app, where they are rated, saved or shared.

03Highlights
01

Automatic hair mask

A segmentation service finds the hair region in the uploaded photo. Users can refine the mask with a brush and eraser; the face and background never change.

02

Style, color or your own description

Preset hairstyles, a wide color palette and free text. Styles and prompts are served from the backend, so adding a new style doesn't require an app update.

03

Variations

Every generation returns multiple results, and any result you don't like can be regenerated with a single tap.

04

Subscriptions and daily quota

Free and Pro plans differ in daily generation quota, style and color options, HD results and watermarking. Subscriptions are verified on the server through RevenueCat and App Store notifications.

05

Easy sign-in

Sign in with Apple, Google, Instagram or a code sent by email. Users who start as guests can save their account later.

06

Feedback loop

Every result can be rated and commented on; the feedback shows which styles and prompts work well.

05Architecture
01Mobile
  • Sign in with Apple and GoogleIdentity token
  • Mobile appiOS and Android · Expo
  • RevenueCatSubscriptions and purchases
02Server
  • Shared APIJWT · daily quota · app settings
  • Generation queueFeeds pending jobs to the GPU in order
03Data and AI
  • MySQLUsers, jobs and subscriptions
  • AWS S3Photos, masks and results
  • Hair segmentationAutomatic mask
  • Serverless GPUStable Diffusion inpainting
  • GPU serverBackup generation pipeline

The photo reaches the API, the hair mask is extracted, the job is written to the queue, and the app immediately gets a job ID back. The queue hands the job to a GPU and the results are written to S3; the app polls for status and fetches the results directly from S3 through signed URLs. Photart uses the same API and queue.

External service
  • Mobile app → Sign in with Apple and Google
  • Mobile app → RevenueCat
  • Mobile app → Shared API (REST · JWT)
  • RevenueCat → Shared API (webhook)
  • Shared API → Generation queue
  • Shared API → MySQL
  • Shared API → AWS S3
  • Shared API → Hair segmentation (mask)
  • Generation queue → Serverless GPU (inpainting)
  • Generation queue → GPU server
06Technology
01

Mobile

One codebase for iOS and Android

  • React Native
  • Expo
  • TypeScript
  • Redux Toolkit
  • i18nextMultilingual interface
  • UI KittenTheming and components
02

Backend

A shared API serving multiple apps

  • Java 17
  • Spring Boot 3
  • Spring Security
  • JWT
  • MySQL
  • AWS S3
03

AI

From mask to new hair

  • Hair segmentationAutomatic mask
  • Stable DiffusionInpainting
  • RunPodServerless GPU
  • AWSGPU server
04

Services

Sign-in and subscriptions

  • RevenueCat
  • Sign in with Apple
  • Sign in with Google