Dynamic Car Drawing Animation Creation with Google Veo 3.1

Transform static car image to an animated video of drawings into immersive animated videos with synchronized audio using Google Veo 3.1.

~$0.9179
 1import requests
 2import time
 3import json
 4
 5api_key = "YOUR_API_KEY"
 6url = "https://api.segmind.com/workflows/68f87776f91518114626afa7-v1"
 7
 8data = {
 9    "Input_Prompt": "A hyper-realistic sequence showing a photorealistic car (exactly as the reference image given) emerging from a detailed pencil sketch on a cluttered architect's desk.\", \"camera\": { \"type\": \"Slow Arc Shot\", \"lens\": \"100mm Macro Prime\", \"aperture\": \"f/2.8\", \"position\": \"Starts as an extreme close-up on the pencil drawing, then slowly pulls back and arcs around the car as it transitions to a 3D object.\", \"environment\": { \"location\": \"A designer's or engineer's drafting table.\", \"details\": \"The surface is a sheet of high-quality, slightly textured white paper covered in technical blueprints and schematics of the car. Several graphite and colored pencils, an eraser, and a compass are scattered around the main drawing. The background is a dark, out-of-focus workshop.\" }, \"lighting\": { \"primary_source\": { \"type\": \"Architect's Desk Lamp\", \"position\": \"Just out of frame, to the top left.\", \"fill_light\": { \"type\": \"Soft Ambient Light\", \"source\": \"From the out-of-focus workshop background.\", \"color\": \"Cool, bluish tint.\", \"intensity\": \"Low, to gently lift the darkest shadows and add depth to the scene.\" } }, \"main_subject\": { \"name\": \"The Formula 1 Car\", \"initial_state\": \"A masterful, hyper-realistic pencil drawing. The lines are precise, the shading is smooth, and there's a sense of depth even in 2D.\", \"final_state\": \"A fully realized, photorealistic 3D model of the Red Bull F1 car. The materials are perfect: glossy carbon fiber, metallic paint with livery, and soft-sheen rubber tires.\", \"animation\": { \"0.0s - 2.0s\": \"The camera is focused on the drawing. A photorealistic hand enters the frame with an eraser and gently removes a few faint construction lines from the sketch.\", \"2.0s - 7.0s\": \"A magical 'wave' of transformation begins at the front wing of the car and sweeps backward. As it passes, the 2D pencil lines and shading seamlessly transform into 3D, textured materials. The drawn debris on the track lifts up and becomes real, floating for a moment before settling.\", \"7.0s - 8.0s\": \"The transformation is complete. The car is now fully 3D, sitting on the paper as if it's a real, miniature vehicle. The engine subtly whirs to life, and the exhaust vents emit a tiny, realistic heat haze.\" } }, \"audio_design\": { \"style\": \"Transformative, from quiet and organic to powerful and cinematic.\", \"timeline\": [ { \"time\": \"0.0s - 2.0s\", \"sound\": \"The soft, realistic sound of a pencil's graphite scratching on paper, and the gentle 'shhh' of an eraser.\" }, { \"time\": \"2.0s - 7.0s\", \"sound\": \"A low, magical humming and shimmering sound that grows in intensity and pitch as the transformation wave moves across the car. This is layered with an epic, swelling orchestral score.\" }, { \"time\": \"7.0s - 8.0s\", \"sound\": \"The orchestral score reaches a crescendo. A final, satisfying 'click' as the transformation completes, followed by the low, powerful hum and subtle electronic whir of the car's idling engine.\" } ] },",
10    "Image_Input": "https://segmind-inference-inputs.s3.amazonaws.com/6fbbfb68-779f-4e98-a59e-c871fed05016-HD-wallpaper-a-lovely-car-koenigsegg-white-background-car.jpg"
11}
12
13def poll_for_result(poll_url):
14    """Poll the API until the generation is complete"""
15    while True:
16        response = requests.get(
17            poll_url,
18            headers={'Authorization': f'Bearer {api_key}'}
19        )
20        result = response.json()
21
22        if result['status'] == 'COMPLETED':
23            # Parse the output (it's a JSON string)
24            outputs = json.loads(result['output'])
25            return outputs
26        elif result['status'] == 'FAILED':
27            raise Exception(result.get('error', 'Generation failed'))
28
29        # Wait 7 seconds before polling again
30        time.sleep(7)
31
32# Make the initial request
33response = requests.post(
34    url,
35    json=data,
36    headers={
37        'Authorization': f'Bearer {api_key}',
38        'Content-Type': 'application/json'
39    }
40)
41
42if response.status_code == 200:
43    result = response.json()
44    print('Request queued:', result)
45
46    # Start polling for results
47    outputs = poll_for_result(result['poll_url'])
48    print('Generation complete:', outputs)
49else:
50    print(f"Error: {response.status_code}")
51    print(response.text)

API Endpoint

POSThttps://api.segmind.com/workflows/68f87776f91518114626afa7-v1

Parameters

Input_Promptoptional
string

Input Prompt

Default: "A hyper-realistic sequence showing a photorealistic car (exactly as the reference image given) emerging from a detailed pencil sketch on a cluttered architect's desk.\", \"camera\": { \"type\": \"Slow Arc Shot\", \"lens\": \"100mm Macro Prime\", \"aperture\": \"f/2.8\", \"position\": \"Starts as an extreme close-up on the pencil drawing, then slowly pulls back and arcs around the car as it transitions to a 3D object.\", \"environment\": { \"location\": \"A designer's or engineer's drafting table.\", \"details\": \"The surface is a sheet of high-quality, slightly textured white paper covered in technical blueprints and schematics of the car. Several graphite and colored pencils, an eraser, and a compass are scattered around the main drawing. The background is a dark, out-of-focus workshop.\" }, \"lighting\": { \"primary_source\": { \"type\": \"Architect's Desk Lamp\", \"position\": \"Just out of frame, to the top left.\", \"fill_light\": { \"type\": \"Soft Ambient Light\", \"source\": \"From the out-of-focus workshop background.\", \"color\": \"Cool, bluish tint.\", \"intensity\": \"Low, to gently lift the darkest shadows and add depth to the scene.\" } }, \"main_subject\": { \"name\": \"The Formula 1 Car\", \"initial_state\": \"A masterful, hyper-realistic pencil drawing. The lines are precise, the shading is smooth, and there's a sense of depth even in 2D.\", \"final_state\": \"A fully realized, photorealistic 3D model of the Red Bull F1 car. The materials are perfect: glossy carbon fiber, metallic paint with livery, and soft-sheen rubber tires.\", \"animation\": { \"0.0s - 2.0s\": \"The camera is focused on the drawing. A photorealistic hand enters the frame with an eraser and gently removes a few faint construction lines from the sketch.\", \"2.0s - 7.0s\": \"A magical 'wave' of transformation begins at the front wing of the car and sweeps backward. As it passes, the 2D pencil lines and shading seamlessly transform into 3D, textured materials. The drawn debris on the track lifts up and becomes real, floating for a moment before settling.\", \"7.0s - 8.0s\": \"The transformation is complete. The car is now fully 3D, sitting on the paper as if it's a real, miniature vehicle. The engine subtly whirs to life, and the exhaust vents emit a tiny, realistic heat haze.\" } }, \"audio_design\": { \"style\": \"Transformative, from quiet and organic to powerful and cinematic.\", \"timeline\": [ { \"time\": \"0.0s - 2.0s\", \"sound\": \"The soft, realistic sound of a pencil's graphite scratching on paper, and the gentle 'shhh' of an eraser.\" }, { \"time\": \"2.0s - 7.0s\", \"sound\": \"A low, magical humming and shimmering sound that grows in intensity and pitch as the transformation wave moves across the car. This is layered with an epic, swelling orchestral score.\" }, { \"time\": \"7.0s - 8.0s\", \"sound\": \"The orchestral score reaches a crescendo. A final, satisfying 'click' as the transformation completes, followed by the low, powerful hum and subtle electronic whir of the car's idling engine.\" } ] },"
Image_Inputoptional
string (uri)

Image Input

Default: "https://segmind-inference-inputs.s3.amazonaws.com/6fbbfb68-779f-4e98-a59e-c871fed05016-HD-wallpaper-a-lovely-car-koenigsegg-white-background-car.jpg"

Response Format

Returns: Polling-based asynchronous response

Initial request returns a poll_url. Poll every 7 seconds until status is COMPLETED.

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Workflow not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out