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
| Name | Type | Required | Description |
|---|---|---|---|
fatherImage | string | yes | Remote URL of image of the father's face |
motherImage | string | yes | Remote URL of image of the mother's face |
gender | (babyBoy, babyGirl) | yes | Desired gender for the baby |
⚠️ Important: Do not Send Base64 Image
Header
| Name | Type | Required | Description |
|---|---|---|---|
x-api-key | string | yes | Your 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 implementationinterface BabyGeneratorParams { fatherImage: string; motherImage: 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({ fatherImage: params.fatherImage, motherImage: params.motherImage, 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
| Name | Type | Required | Description |
|---|---|---|---|
x-api-key | string | yes | Your 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 implementationasync 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
| Status | Description |
|---|---|
| creating | Job is being initialized |
| pending | Job is in processing queue |
| running | Job is actively processing |
| completed | Processing finished successfully |
| failed | Processing encountered an error |
| not-found | Invalid 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'
}