Hair Style Changer

Hair Style Changer

Overview

The Hair Style Changer is a powerful AI tool that lets you transform your hairstyle in photos with just a few clicks. You can experiment with different hairstyles without visiting a salon! Here are the styles you can try:

  • Perm: Gives you bouncy, permanently waved hair
  • Curly: Transforms your hair into beautiful natural-looking curls
  • Straight: Makes your hair sleek and straight
  • Stubble: Creates a short, cropped hairstyle
  • Ponytail: Pulls your hair back into a classic ponytail
  • Dreadlock: Creates traditional rope-like strands of hair
  • Dreads: Alternative style of dreadlocks
  • French Twist: Elegant updo style where hair is twisted and secured at the back

Simply upload your photo, choose your desired hair color, and select one of these hairstyles to see how you'd look with a new style!

API Reference

  • URL: https://api.maxstudio.ai/hair-style-changer
  • Method: POST

API Parameters

NameTypeRequiredDescription
imagestringyesBase64 encoded image
hairColor(red, pink, brown, black, grey, blue)yesDesired hair color
hairStyle(perm, curly, straight, strubble, ponytall, deadlock, dreads, frenchwist)yesDesired hair style

⚠️ Important: When sending the base64 image, do not include the prefix (e.g., 'data:image/jpeg;base64,'). Send only the raw base64 string.

Header

NameTypeRequiredDescription
x-api-keystringyesYour API key obtained from the MaxStudio APIs Dashboard (opens in a new tab). Generate this key by logging into your account and navigating to the API Keys section.

Code Examples

// TypeScript implementation
interface Params {
image: string;
hairColor: string;
hairStyle: string;
}
async function HairStyleChanger(image: string, hairColor: string, hairStyle: string): Promise<any> {
try {
const response = await fetch('https://api.maxstudio.ai/hair-style-changer', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
image: image,
hairColor: hairColor,
hairStyle: hairStyle
})
});
const jobId = await response.json();
return jobId;
} catch (error) {
console.error('Error:', error);
throw error;
}
}

Success Response

{
  "jobId": "<job_id>"
}

Error Response Examples

// Rate Limit Error
{
  "status": 429,
  "error": "Rate limit exceeded. Please try again later."
}
// Insufficient Credits
{
  "status": 402,
  "error": "Insufficient credits. Please Buy credits."
}
// Invalid Input
{
  "status": 400,
  "error": "Image size must be less than 5MB"
}

Get Job Status

Header

NameTypeRequiredDescription
x-api-keystringyesYour API key obtained from the MaxStudio APIs Dashboard (opens in a new tab). Generate this key by logging into your account and navigating to the API Keys section.

To check the status of your job, use the following examples:

// TypeScript implementation
async function getJobStatus(jobId: string): Promise<any> {
const url = `https://api.maxstudio.ai/hair-style-changer/${jobId}`;
try {
const response = await axios.get(url);
const jobId = await response.json();
return jobId;
} catch (error) {
console.error('Error:', error);
throw error;
}
}

Job Status Reference

StatusDescription
creatingJob is being initialized
pendingJob is in processing queue
runningJob is actively processing
completedProcessing finished successfully
failedProcessing encountered an error
not-foundInvalid or expired job ID

Output

{
  "status": "<status>",  // One of the status values from the table above
  "result": "<result>"   // Base64 encoded image data when status is 'completed'
}