Vidu Template

vidu-template

Fast Inference
REST API

Model Information

Response Time~100 sec
StatusActive
Version
0.0.1
Updated8 days ago

Prerequisites

  • Create an API Key from the Eachlabs Console
  • Install the required dependencies for your chosen language (e.g., requests for Python)

API Integration Steps

1. Create a Prediction

Send a POST request to create a new prediction. This will return a prediction ID that you'll use to check the result. The request should include your model inputs and API key.

import requests
import time
API_KEY = "YOUR_API_KEY" # Replace with your API key
HEADERS = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
}
def create_prediction():
response = requests.post(
"https://api.eachlabs.ai/v1/prediction/",
headers=HEADERS,
json={
"model": "vidu-template",
"version": "0.0.1",
"input": {
"seed": 0,
"image_url": "your image url here",
"template_name": "minecraft"
},
"webhook_url": ""
}
)
prediction = response.json()
if prediction["status"] != "success":
raise Exception(f"Prediction failed: {prediction}")
return prediction["predictionID"]

2. Get Prediction Result

Poll the prediction endpoint with the prediction ID until the result is ready. The API uses long-polling, so you'll need to repeatedly check until you receive a success status.

def get_prediction(prediction_id):
while True:
result = requests.get(
f"https://api.eachlabs.ai/v1/prediction/{prediction_id}",
headers=HEADERS
).json()
if result["status"] == "success":
return result
elif result["status"] == "error":
raise Exception(f"Prediction failed: {result}")
time.sleep(1) # Wait before polling again

3. Complete Example

Here's a complete example that puts it all together, including error handling and result processing. This shows how to create a prediction and wait for the result in a production environment.

try:
# Create prediction
prediction_id = create_prediction()
print(f"Prediction created: {prediction_id}")
# Get result
result = get_prediction(prediction_id)
print(f"Output URL: {result['output']}")
print(f"Processing time: {result['metrics']['predict_time']}s")
except Exception as e:
print(f"Error: {e}")

Additional Information

  • The API uses a two-step process: create prediction and poll for results
  • Response time: ~100 seconds
  • Rate limit: 60 requests/minute
  • Concurrent requests: 10 maximum
  • Use long-polling to check prediction status until completion

Overview

Vidu Template is a video generation model that transforms static images into dynamic videos by applying a variety of predefined motion templates. By leveraging advanced diffusion techniques, it enables users to create engaging visual content without requiring extensive video editing skills.

Technical Specifications

Image Quality: Use high-resolution images with clear subjects to ensure optimal video output.

Template Selection: Choose templates that align with the content and mood of your image for coherent results.

Seed Consistency: Setting a specific seed value allows for reproducible results, which is useful for iterative design processes.

Key Considerations

Template Limitations: Some templates may require specific image compositions or multiple images to function correctly.

Content Appropriateness: Ensure that the selected template matches the context and subject of the image to avoid incongruent results.

Legal Information for Vidu Template

By using this Vidu Template, you agree to:

Vidu Terms Of Use

Vidu Privacy Policy

Tips & Tricks

Image URL: Provide a direct URL to a high-quality image. Ensure the image is well-lit and the subject is clearly visible.

Seed: Use a fixed integer value to reproduce specific results. For varied outputs, allow the seed to be randomly assigned.

Template Name: Select from the available templates that best suit your image's theme. For example:

  • hugging for affectionate scenes
  • ghibli for a whimsical, animated style
  • fashion_stride for runway or fashion-related images.

Experiment with different templates to discover the most fitting effect for your image.

Capabilities

Image-to-Video Transformation: Convert static images into dynamic videos using a variety of motion templates

Template Diversity: Access a broad selection of templates to apply different styles and effects to your images.

What can I use for?

Social Media Content: Create engaging videos for platforms like Instagram, TikTok, or Facebook.

Marketing Materials: Develop dynamic visuals for promotional campaigns or advertisements.

Personal Projects: Transform personal photos into animated keepsakes or digital art pieces.

Storytelling: Enhance narratives by adding motion to illustrative images or storyboards.

Things to be aware of

Template Exploration: Test various templates with the same image to observe different stylistic outcomes

Seed Variation: Adjust the seed value to generate diverse versions of the same template effect.

Image Pairing: Combine multiple images in templates that support multi-image inputs to create more complex animations.

Limitations

Template Dependency: The quality of the output is heavily reliant on the chosen template and its compatibility with the input image.

Static Input: Currently, Vidu Template only supports static images as input; it does not process video or animated inputs.

Output Format: MP4