See the haircut before the scissors
A customer uploads one photo, picks a style, and gets a photograph of themselves wearing it. 12 hairstyle categories, from box braids to a pixie cut, generated on a face the app has never seen before.










The problem
A haircut is a decision you cannot take back, and nobody could show the customer the result first.
People commit to a style from a reference photo of somebody else's face. There was no way to see a braid pattern, a taper, or a crop on their own hair, at their own length, before the appointment.
Existing filters were the giveaway. Hair drawn on top of a photo reads as a sticker: the edge is wrong, the lighting is wrong, and the customer stops believing the preview. Getting it to look like a photograph is the whole product, and it has to hold across hair types, lengths, and textures.
What we built
One Photo In, a Photograph of a Different You Out
The app finds the face, separates hair from everything else, composites the chosen style onto the head, blends the seam, and restores the face so it still looks like the person who took the photo.
01 · Upload and detect
Any photo becomes a usable canvas.
The customer shoots or picks a JPEG or PNG. The app locates the face, reads its landmarks and orientation, and separates hair from skin and background so the style has a clean boundary to sit against.
02 · Composite and blend
The style is grown onto the head, not pasted over it.
A custom model built on Barbershop composites the reference style with the customer's photo using segmentation masks, so the edit is confined to the hair. Old hair is painted out, gaps are filled, and the seam is blended until the transition reads as one exposure.
03 · Restore the face
The person still looks like themselves.
Face restoration runs after the composite so features stay sharp and unchanged through the edit. Every result is checked against the original before it is shown — that is what separates a preview a customer trusts from a filter they laugh at.
The solution
The Whole App, Not Just the Model
A generated photo is worth nothing if the customer cannot get to it, keep it, or show it to somebody. Eight features ship around the pipeline, and every one of them is what turns a try-on into a habit.
01 · Access
Sign In Before Anything Uploads
Accounts are created and authenticated first, so every photo that enters the pipeline already belongs to somebody.
02 · Input
Shoot It or Pick It
The camera and the gallery both feed the same upload step, in JPEG or PNG, in as few taps as the phone allows.
03 · Choice
A Style Library, Not a Single Filter
Predefined styles span lengths and textures, so the customer browses looks rather than fighting settings.
04 · Result
Generated in the App, Watermarked by Tier
Free results carry a watermark, paid results do not. The same pipeline serves both, so the upgrade changes the file, never the quality.
05 · Keep
A Private Gallery Behind the Login
Styled results and past uploads stay saved to the account, ready to re-open before the appointment.
06 · Share
Straight Out to Instagram and Facebook
Sharing runs from the result screen and the gallery both, and a paid customer's post goes out clean.
07 · Learn
HairduKation Keeps People in the App
Articles, tutorials, and technique tips sit alongside the try-on, giving the customer a reason to open it between haircuts.
08 · Revenue
Ads Pay for the Free Tier
AdSense-served placements run around generation, and the paid tier removes both the ads and the watermark.
Style showcase
12 Categories, Each One Validated Against a Real Before and After
Texture is where try-on tools usually fail. The showcase set was chosen to cover locs, braids, coils, waves, and straight hair, because a model that only works on one of them is not shippable.
Drag across any card to wipe between the original and the result
























Dataset discipline
The Output Is Only as Good as the Reference Photo
Before any image was used as a style reference, it passed five checks. One face, fully in frame, clearly visible, large enough to read, facing forward. Anything else was rejected rather than cleaned up.
That screen is the cheapest quality control in the pipeline. Bad references produce misaligned hairlines and warped edges no amount of blending recovers.
Rejected for
Why
Face obscured
The face is not clearly visible.
Multiple faces
More than one face in frame; only one is needed per image.
Incomplete face
The face is cut off by the edge of the frame.
Face too small
The face occupies too small a portion of the image.
Wrong pose
The subject is not facing forward with a straight pose.
How it works underneath
A Generative Pipeline, Tuned on Our Own Dataset, Running on GPU Infrastructure
Hair and blur segmentation isolates the region to be replaced. A GAN-based compositor built on Barbershop blends the customer's photo with the chosen style reference using those masks. Inpainting removes the original hair and fills what it leaves behind, then masking adjustments and blending passes clean the boundary. Stable diffusion, fine-tuned with LoRA and steered by ControlNet and IP-Adapter, handles realism and face restoration. The whole thing runs on GPU deployment infrastructure with image sizing handled server-side, so a phone only has to upload and display.

Built to Be Trusted
The Stack Behind It, and What It's Held To
Every piece above runs on a named stack, not a black box, and every deployment is held to the same four guarantees.
Production stack
Photos and account data are encrypted in transit and at rest.
Accounts are gated before a single upload reaches the pipeline.
Every reference image was reviewed before it entered training.
The same models, the same results, on both stores.
What shipped
A Consumer App on Both Stores, and the Model That Makes It Worth Opening
iOS and Android, covering login, upload, style selection, generation, gallery, sharing, and the HairduKation education section.
A custom Barbershop-based generative pipeline that composites a chosen style onto an uploaded photo using segmentation masks.
Free results carry a watermark and in-app ads. A paid tier removes both, so the free tier markets the product it upsells.
The outcome
A Preview the Customer Believes, on Both Stores, Across Every Hair Type We Tested
The numbers below come from the same place the product does: fewer wasted hours screening reference photos, coverage across the styles people actually ask for, and a free session that pays for itself. All of it rests on whether somebody recognises themselves in the result.
Five screening rules catch unusable reference photos before annotation starts, not halfway through it
Braided, natural, straight, short and textured families; the gaps are the niche, personalized cuts
Ads run during the generation wait, when the customer is watching rather than scrolling past
A decision made before the appointment
The customer walks in having already seen the style on their own face, so the conversation with the stylist starts from a picture instead of a description.
A free tier that sells the paid one
Watermarked results and in-app ads fund the free experience, and the upgrade removes both, so the thing being marketed is the product itself.
A spine that transfers
Segmentation, masked compositing, and diffusion blending on a user photo is the same pattern behind glasses, makeup, and apparel try-on with a different reference set.
Questions we get asked
Common Questions About a System Like This
Does it work on every hair type?
The showcase set was deliberately built across locs, braids, coils, waves, and straight hair rather than one texture, and each category was validated on a before and after pair before it was accepted.
What happens to a customer's photo?
Uploads sit behind secure authentication, are encrypted at rest, and are only reachable from the customer's own logged-in gallery.
Can this be adapted to another product category?
Yes. The pattern underneath is segmentation, masked compositing, and diffusion-based blending on a user photo. Glasses, makeup, and apparel try-on use the same spine with a different reference set.
What makes a photo get rejected?
Five checks run before an image is usable as a reference: one face, fully in frame, clearly visible, large enough to read, and facing forward. Anything failing one of them is rejected rather than cleaned up, because a bad reference produces a misaligned hairline no amount of blending recovers.
Does the phone do the processing?
No. Generation and image sizing run on GPU infrastructure server-side, so the app only has to upload and display. That is what keeps results consistent between a new iPhone and a three-year-old Android.
How does the free tier make money?
Free results carry a watermark and the app serves ads around generation. The paid tier removes both, so the free tier is the marketing for the thing it upsells rather than a stripped-down product.
Have a build like this in mind?
30 minutes, and you will know whether it holds up in production.
Related work



