Image Style Transfer

Image Style Transfer

Overview

An advanced AI tool for applying various artistic styles to images. This API supports multiple style transfers including gibli, Anime, Halloween, Cartoon, and Christmas themes.

API Reference

  • URL: https://api.maxstudio.ai/image-style-transfer
  • Method: POST

API Parameters

NameTypeRequiredDescription
imagestringyesBase64 encoded image
stylestringyesAvailable styles: "gibli", "anime", "halloween", "cartoon", "christmas"

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

Headers

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.

Available Styles

Style NameDescription
gibliTransforms images into Studio gibli animation style
animeConverts images into anime/manga art style
halloweenApplies spooky Halloween themed effects
cartoonTransforms images into cartoon style artwork
christmasAdds festive Christmas themed elements

Code Examples

// TypeScript implementation
type StyleType = "gibli" | "anime" | "halloween" | "cartoon" | "christmas";
interface Params {
image: string;
style: StyleType;
}
async function ImageStyleTransfer(params: Params): Promise<any> {
try {
const response = await fetch('https://api.maxstudio.ai/image-style-transfer', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
image: params.image,
style: params.style
})
});
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"
}
// Invalid Style
{
  "status": 400,
  "error": "Invalid style. Available styles: gibli, anime, halloween, cartoon, christmas"
}

Get Job Status

Headers

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/image-style-transfer/${jobId}`;
try {
const response = await fetch(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'
}