POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 const axios = require('axios'); const FormData = require('form-data'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/tooncrafter"; const reqBody = { "loop": false, "seed": 42, "prompt": "cartoon character animation", "image_1": "https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t1.jpg", "image_2": "https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t2.jpg", "image_3": "https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t3.jpg", "image_4": "https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t4.jpg", "image_5": "https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t5.jpg", "image_6": "https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t6.jpg", "max_width": 512, "max_height": 512, "interpolate": false, "negative_prompt": "low quality", "color_correction": true }; (async function() { try { const formData = new FormData(); // Append regular fields for (const key in reqBody) { if (reqBody.hasOwnProperty(key)) { formData.append(key, reqBody[key]); } } // Convert and append images as Base64 if necessary const response = await axios.post(url, formData, { headers: { 'x-api-key': api_key, ...formData.getHeaders() } }); console.log(response.data); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


loopbool ( default: 1 )

Loop the video


seedint ( default: 42 )

Set a seed for reproducibility. Random by default.


promptstr ( default: cartoon character animation )

Enter your prompt


image_1str *

First input image


image_2str *

Second input image


image_3str ( default: https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t3.jpg )

Third input image (optional)


image_4str ( default: https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t4.jpg )

Fourth input image (optional)


image_5str ( default: https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t5.jpg )

Fifth input image (optional)


image_6str ( default: https://segmind-sd-models.s3.amazonaws.com/display_images/tooncrafter/t6.jpg )

Sixth input image (optional)


image_7str ( default: 1 )

Seventh input image (optional)


image_8str ( default: 1 )

Eighth input image (optional)


image_9str ( default: 1 )

Ninth input image (optional)


image_10str ( default: 1 )

Tenth input image (optional)


max_widthenum:str ( default: 512 )

Maximum width of the video

Allowed values:


max_heightenum:str ( default: 512 )

Maximum height of the video

Allowed values:


interpolatebool ( default: 1 )

Enable 2x interpolation using FILM


negative_promptstr ( default: low quality )

Things you do not want to see in your video


color_correctionbool ( default: true )

If the colors are coming out strange, or if the colors between your input images are very different, disable this

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Tooncrafter

Tooncrafter leverages the cutting-edge world of image-to-video diffusion models. Imagine feeding it just a few keyframes – depicting the starting pose of your character and another showcasing the ending pose, Tooncrafter then seamlessly generating all the intermediate frames, bringing your characters to life with smooth, natural-looking animation.

Here's what sets Tooncrafter helps in effortless animation creation:

  • Animation from few Images: Tooncrafter requires just a few cartoon frames – a starting point and an ending point. The model then uses its magic to create all the intermediate frames, seamlessly transitioning between images.

  • Control the Motion: While Tooncrafter excels at generating natural movements, it also empowers you to exert control. Through a sketch-based interface, you can provide additional guidance to the model, influencing the movement of specific objects or characters within the animation.

  • Exceptional Handling of Non-Linear Motion: Complex actions with significant character movement or object disocclusion (objects appearing or disappearing) can be tricky for animation software. Tooncrafter tackles these challenges head-on, generating smooth and convincing transitions even in such scenarios.

This innovative technology is a game-changer for animators of all levels. For professional studios, ToonCrafter acts as a powerful time-saving asset, automating the in-betweening process and freeing up animators to focus on refining details and storytelling. Budding animators and hobbyists can use ToonCrafter to bring their creative visions to life without the need for years of painstaking frame-by-frame animation.