## Basic model info - Model name: bytedance/bytedance seedance-2.0-relay - Model description: Seedance 2.0 video generation via opengw relay gateway. - Endpoint name: image-to-video ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/bytedance/seedance-2.0-relay/latest.json) ### Model input schema The model input schema is: ```json { "properties": { "prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Text prompt for video generation (optional)", "title": "Prompt", "x-sr-order": 200 }, "start_image": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" } ], "description": "URL of the image to use as the first frame. Formats: jpeg/png/webp/bmp/tiff/gif, aspect ratio 0.4-2.5, size 300-6000px, max 30MB.", "title": "Start Image", "x-sr-order": 301 }, "end_image": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" }, { "type": "null" } ], "description": "URL of the image to use as the last frame (optional). Same requirements as start_image.", "title": "End Image", "x-sr-order": 302 }, "duration": { "default": 5, "description": "Duration of the video in seconds (4-15, or -1 for auto). Must be >= 4 unless -1.", "maximum": 15, "minimum": -1, "title": "Duration", "type": "integer", "x-sr-order": 403 }, "generate_audio": { "default": true, "description": "Whether to generate synchronized audio for the video", "title": "Generate Audio", "type": "boolean", "x-sr-order": 501 }, "ratio": { "default": "adaptive", "description": "Aspect ratio of the video. 'adaptive' will auto-select based on the first frame image.", "enum": [ "21:9", "16:9", "4:3", "1:1", "3:4", "9:16", "adaptive" ], "title": "Ratio", "type": "string", "x-sr-order": 402 }, "resolution": { "default": "720p", "description": "Video resolution", "enum": [ "480p", "720p", "1080p" ], "title": "Resolution", "type": "string", "x-sr-order": 401 } }, "required": [ "start_image" ], "title": "ImageToVideoInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "description": "Output schema for Seedance 2.0 video generation.", "properties": { "total_tokens": { "description": "Total tokens consumed for this generation", "title": "Total Tokens", "type": "integer" }, "units": { "description": "Billing units. 1000 units = $1.", "title": "Units", "type": "number" }, "video": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" } }, "required": [ "video", "total_tokens", "units" ], "title": "Seedance20Output", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": null, "start_image": "", "end_image": null, "duration": 5, "generate_audio": true, "ratio": "adaptive", "resolution": "720p" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("bytedance/seedance-2.0-relay/image-to-video", { input: { prompt: null, start_image: '', end_image: null, resolution: '720p', ratio: 'adaptive', duration: 5, generate_audio: true }, logs: true, onQueueUpdate: (update) => { console.log(`Status Update: ${update.status}, Request ID: ${update.request_id}`); }, }); console.log(result.data); console.log(result.requestId); ``` ### Python ```python import sunra_client result = sunra_client.subscribe( "bytedance/seedance-2.0-relay/image-to-video", arguments={ "prompt": None, "start_image": "", "end_image": None, "resolution": "720p", "ratio": "adaptive", "duration": 5, "generate_audio": True }, with_logs=True, on_enqueue=print, on_queue_update=print, ) print(result) ``` ### Java ```java import ai.sunra.client.*; import java.util.Map; import com.google.gson.JsonObject; var client = SunraClient.withEnvCredentials(); var response = client.subscribe( "bytedance/seedance-2.0-relay/image-to-video", SubscribeOptions.builder() .input(Map.of( "prompt", null, "start_image", "", "end_image", null, "resolution", "720p", "ratio", "adaptive", "duration", 5, "generate_audio", true)) .resultType(JsonObject.class) .onQueueUpdate(update -> System.out.printf( "\nStatus Update: %s, Request ID: %s%n", update.getStatus(), update.getRequestId() )) .logs(true) .build() ); System.out.println("Completed!"); System.out.println(response.getData()); ``` ### Kotlin ```kotlin import ai.sunra.client.kt.* import com.google.gson.JsonObject val client = createSunraClient() val response = client.subscribe( endpointId = "bytedance/seedance-2.0-relay/image-to-video", input = mapOf( "prompt" to null, "start_image" to "", "end_image" to null, "resolution" to "720p", "ratio" to "adaptive", "duration" to 5, "generate_audio" to true), options = ai.sunra.client.kt.SubscribeOptions(logs = true), onUpdate = { update -> println("\nStatus Update: ${update.status}, Request ID: ${update.requestId}") } ) println("Completed!") println(response.data) ``` ### Curl ```bash curl --request POST \ --url https://api.sunra.ai/v1/queue/bytedance/seedance-2.0-relay/image-to-video \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":null,"start_image":"","end_image":null,"resolution":"720p","ratio":"adaptive","duration":5,"generate_audio":true}' ``` ## Model readme >