POST
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 50 51 52 import requests api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/tooncrafter" # Prepare data and files data = {} files = {} data['loop'] = False data['seed'] = 42 data['prompt'] = "cartoon character animation" # For parameter "image_1", you can send a raw file or a URI: # files['image_1'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_1'] = 'IMAGE_URI' # To send a URI # For parameter "image_2", you can send a raw file or a URI: # files['image_2'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_2'] = 'IMAGE_URI' # To send a URI # For parameter "image_3", you can send a raw file or a URI: # files['image_3'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_3'] = 'IMAGE_URI' # To send a URI # For parameter "image_4", you can send a raw file or a URI: # files['image_4'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_4'] = 'IMAGE_URI' # To send a URI # For parameter "image_5", you can send a raw file or a URI: # files['image_5'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_5'] = 'IMAGE_URI' # To send a URI # For parameter "image_6", you can send a raw file or a URI: # files['image_6'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_6'] = 'IMAGE_URI' # To send a URI # For parameter "image_7", you can send a raw file or a URI: # files['image_7'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_7'] = 'IMAGE_URI' # To send a URI # For parameter "image_8", you can send a raw file or a URI: # files['image_8'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_8'] = 'IMAGE_URI' # To send a URI # For parameter "image_9", you can send a raw file or a URI: # files['image_9'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_9'] = 'IMAGE_URI' # To send a URI # For parameter "image_10", you can send a raw file or a URI: # files['image_10'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_10'] = 'IMAGE_URI' # To send a URI data['max_width'] = 512 data['max_height'] = 512 data['interpolate'] = False data['negative_prompt'] = "low quality" data['color_correction'] = True headers = {'x-api-key': api_key} response = requests.post(url, data=data, files=files, headers=headers) print(response.content) # The response is the generated image
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.