SJinn
Sora2 Image-to-Video

Sora2 Image-to-Video

Generate high-quality videos from images and text descriptions using OpenAI's Sora2 model

Tool Overview

The Sora2 Image-to-Video tool uses OpenAI's Sora2 model to generate high-quality video content based on a starting image and text description. It supports both Fast and Pro generation modes, as well as multiple video duration options.

Tool Identifier

sora2-image-to-video-api

Parameters

Required Parameters

prompt

  • Type: string (required)
  • Description: Text description of the video content to guide AI video motion and scene changes
  • Validation: Must be a non-empty string
  • Example: "The camera slowly pans around the scene while maintaining focus on the subject"

image

  • Type: string (required)
  • Description: Image URL for the video's starting frame
  • Format: Must be a complete HTTP/HTTPS URL (e.g., https://cdn.sjinn.ai/uploads/image.jpg)
  • Validation: Must be a non-empty string

Optional Parameters

aspect_ratio

  • Type: string (optional)
  • Default: "16:9"
  • Available Values: "16:9", "9:16"
  • Note: If an invalid value is provided, the default value will be used

mode

  • Type: string (optional)
  • Default: "std"
  • Available Values: "std", "pro"
  • Note: Affects credit cost (std: 420 credits, pro: 2100 credits). If an invalid value is provided, the default value will be used

duration

  • Type: number (optional)
  • Default: 10
  • Available Values: 10, 15
  • Unit: seconds
  • Note: If an invalid value is provided, the default value will be used

Pricing

  • Std Mode: 420 credits per task
  • Pro Mode: 2100 credits per task
  • Membership Requirement: None

Request Examples

Std Mode (Default)

curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool_type": "sora2-image-to-video-api",
    "input": {
      "prompt": "The person turns their head and smiles at the camera",
      "image": "https://cdn.sjinn.ai/uploads/portrait.jpg",
      "aspect_ratio": "16:9",
      "duration": 10
    }
  }'

Pro Mode (High Quality)

curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool_type": "sora2-image-to-video-api",
    "input": {
      "prompt": "Cinematic camera movement revealing the full scene",
      "image": "https://cdn.sjinn.ai/uploads/landscape.jpg",
      "aspect_ratio": "16:9",
      "mode": "pro",
      "duration": 15
    }
  }'

Using JavaScript

const response = await fetch('https://sjinn.ai/api/un-api/create_tool_task', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    tool_type: 'sora2-image-to-video-api',
    input: {
      prompt: 'The person turns their head and smiles at the camera',
      image: 'https://cdn.sjinn.ai/uploads/portrait.jpg',
      aspect_ratio: '16:9',
      mode: 'std',
      duration: 10,
    },
  }),
});

const result = await response.json();
console.log('Task ID:', result.data.task_id);

Using Python

import requests

url = 'https://sjinn.ai/api/un-api/create_tool_task'
headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
}
data = {
    'tool_type': 'sora2-image-to-video-api',
    'input': {
        'prompt': 'The person turns their head and smiles at the camera',
        'image': 'https://cdn.sjinn.ai/uploads/portrait.jpg',
        'aspect_ratio': '16:9',
        'mode': 'pro',
        'duration': 15
    }
}

response = requests.post(url, json=data, headers=headers)
result = response.json()
print('Task ID:', result['data']['task_id'])

Response Examples

Success Response

{
  "success": true,
  "errorMsg": "",
  "error_code": 0,
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Error Response

{
  "success": false,
  "errorMsg": "image is required",
  "error_code": 400
}

Mode Comparison

Std Mode

  • Generation Speed: 2-4 minutes
  • Video Quality: High
  • Detail Rendering: Good
  • Motion Smoothness: Good
  • Credit Cost: 420 credits
  • Use Cases: Quick prototyping, testing

Pro Mode

  • Generation Speed: 5-10 minutes
  • Video Quality: Very High
  • Detail Rendering: Excellent
  • Motion Smoothness: Excellent
  • Credit Cost: 2100 credits
  • Use Cases: Final products, commercial use

Best Practices

  1. Image Quality: Use high-quality, clear starting images for better video results
  2. Mode Selection:
    • Use Std mode for testing and rapid iteration
    • Use Pro mode for final products and important projects
  3. Prompt Matching:
    • Ensure text description matches image content
    • Describe specific actions, camera movements, or scene changes
  4. Aspect Ratio Consistency: Starting image aspect ratio should match the aspect_ratio parameter
  5. Duration Selection:
    • Start with 10 seconds for initial testing
    • Use 15 seconds for longer, more complex scenes
  6. Generation Time: Pro mode takes longer, please be patient

Related Links