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);
}
})();
Loop the video
Set a seed for reproducibility. Random by default.
Enter your prompt
First input image
Second input image
Third input image (optional)
Fourth input image (optional)
Fifth input image (optional)
Sixth input image (optional)
Seventh input image (optional)
Eighth input image (optional)
Ninth input image (optional)
Tenth input image (optional)
Maximum width of the video
Allowed values:
Maximum height of the video
Allowed values:
Enable 2x interpolation using FILM
Things you do not want to see in your video
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 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.