Baby Generator

Baby Generator

Overview

Baby Generator is a powerful AI tool that creates a realistic baby image based on the parents' photo. Here's how it works:

  • Upload two photos with clear faces:
    • Father's image: A clear photo of the father's face
    • Mother's image: A clear photo of the mother's face
  • Select the desired gender for your baby:
    • babyBoy: Generate a male baby with combined parental features
    • babyGirl: Generate a female baby with combined parental features
  • Within moments, you'll receive a realistic baby image that inherits characteristics from both parents

API Reference

  • URL: https://api.maxstudio.ai/baby-generator
  • Method: POST

API Parameters

NameTypeRequiredDescription
father_imagestringyesRemote URL of image of the father's face
mother_imagestringyesRemote URL of image of the mother's face
gender(babyBoy, babyGirl)yesDesired gender for the baby

⚠️ Important: Do not Send Base64 Image

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 BabyGeneratorParams {
father_image: string;
mother_image: string;
gender: 'babyBoy' | 'babyGirl';
}
async function generateBaby(params: BabyGeneratorParams): Promise<any> {
try {
const response = await fetch('https://api.maxstudio.ai/baby-generator', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your_api_key'
},
body: JSON.stringify({
father_image: params.father_image,
mother_image: params.mother_image,
gender: params.gender
})
});
const result = await response.json();
return result;
} 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/baby-generator/${jobId}`;
try {
const response = await fetch(url, {
headers: {
'x-api-key': 'your_api_key'
}
});
const result = await response.json();
return result;
} 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": [
    "<URL of Baby Image>"
  ]  // URL to the generated baby image when status is 'completed'
}