r/YouCamAPI • u/PerfectCorp • 12h ago
🚀 Getting Started Hairstyle virtual try-on API: keep the user’s original hair color
Quick tip if you use the AI Hairstyle Virtual Try-On API in Customize mode, where users upload a reference photo of the style they want.
Preset Style already let users keep their own hair color, but Customize didn’t. Before V2.1, it always copied the reference photo’s hair color along with the cut. A user with dark brown hair trying on a blonde reference look came out blonde, whether they wanted that or not.
V2.1 gives Customize the same choice with one optional parameter:
hair_color: "src"→ keeps the user’s own hair color from their uploaded photohair_color: "ref"→ applies the reference image’s hair color (the old Customize behavior)
A few details worth knowing:
- It sits under the
hairTransfereffect (API v1.16+) and applies to Customize mode (style: customize). - If you leave
hair_colorout, it defaults toref. Existing integrations keep working as-is. - The output format is the same, so your Get Result handling doesn’t change.
⚠️ One gotcha: the API Playground defaults to User’s Hair Color, but the API defaults to ref. If your Playground result doesn’t match your first API call, that’s probably why.
To try it without writing code, open the Hairstyle API Playground, set Version to V2.1, go to the Customize tab, and switch between User’s Hair Color and Reference Hair Color. The full parameter reference is in the Hairstyle API docs. For more details, check the V2.1 release post on our blog.
If you’re building hairstyle try-on, which default would your users expect: keeping their own color, or matching the reference? 👇