Video Generation
Image-to-Video
Animate a reference image using a text prompt. Upload the image as a multipart file alongside the request fields.
The image must be at least 300x300 px. JPEG and PNG formats are supported. Use a model that supports the image input modality (e.g. seedance-v1.5-pro-i2v).
Python
python
import requests
BASE_URL = "https://api.oneinfer.ai"
token = requests.post(
f"{BASE_URL}/v1/ula/oauth-authentication?api_key=YOUR_API_KEY"
).json()["access_token"]
with open("reference.jpg", "rb") as img:
response = requests.post(
f"{BASE_URL}/v1/ula/generate-video",
headers={"Authorization": f"Bearer {token}"},
data={
"model": "seedance-v1.5-pro-i2v",
"prompt": "The scene slowly comes alive, gentle breeze, birds flying",
"resolution": "720p",
"aspect_ratio": "landscape",
"duration": 5,
"generate_audio": "false",
"camera_fixed": "false",
"service_tier": "default",
},
files={"files": ("reference.jpg", img, "image/jpeg")},
timeout=180,
)
print(response.json()["data"]["videos"][0]["url"])