> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorone.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Text to Video Generation

> Generate high-quality videos from text descriptions using advanced AI models like ModelScope and Zeroscope

Create engaging videos from text prompts using state-of-the-art video generation models. Generate everything from short clips to longer sequences with precise control over motion, style, and content.

## Request Body

**prompt** `string` *required*

Detailed description of the video you want to generate. Include information about scenes, actions, camera movements, and visual style.

**model** `string` (default: zeroscope-v2)

Video generation model to use:

* `zeroscope-v2` - High-quality general video generation (1024x576)
* `modelscope-t2v` - Realistic video generation (256x256)
* `text2video-zero` - Stable Diffusion-based video generation
* `cogvideo` - Chinese-optimized video generation model

**negativePrompt** `string`

What you don't want in the video (e.g., "blurry, low quality, static, boring")

**duration** `number` (default: 3.0)

Video duration in seconds (1.0 to 10.0 seconds)

**fps** `integer` (default: 8)

Frames per second (4, 8, 12, or 16 fps)

**width** `integer` (default: 1024)

Video width in pixels. Must be multiple of 64. Common: 1024, 768, 512

**height** `integer` (default: 576)

Video height in pixels. Must be multiple of 64. Common: 576, 768, 512

**steps** `integer` (default: 25)

Number of denoising steps. More steps = higher quality but slower generation (10-50)

**guidanceScale** `number` (default: 9.0)

How closely to follow the prompt (1-20). Higher values stick closer to prompt.

**seed** `integer`

Random seed for reproducible results. Leave empty for random generation.

**motionStrength** `number` (default: 0.7)

Amount of motion in the video (0.0 to 1.0). Higher values create more dynamic movement.

**stylePreset** `string`

Style preset for the video:

* `cinematic` - Movie-like quality with cinematic lighting
* `anime` - Anime/cartoon style animation
* `realistic` - Photorealistic style
* `artistic` - Artistic/painterly style
* `vintage` - Retro/vintage film aesthetic

## Response

**videoId** `string`

Unique identifier for the generated video

**status** `string`

Generation status: `queued`, `processing`, `completed`, `failed`

**videoUrl** `string`

Publicly accessible URL to the generated video (available when status is `completed`)

**thumbnailUrl** `string`

URL to video thumbnail/preview image

**duration** `number`

Actual duration of generated video in seconds

**resolution** `object`

Video resolution details

**Resolution Object**

**width** `integer`

Video width in pixels

**height** `integer`

Video height in pixels

**fps** `integer`

Frames per second

**metadata** `object`

Generation metadata

**Metadata Object**

**model** `string`

Model used for generation

**steps** `integer`

Number of steps used

**guidanceScale** `number`

Guidance scale used

**generationTime** `number`

Time taken to generate in seconds

**seed** `integer`

Seed used for generation

**estimatedCompletionTime** `string`

Estimated time until completion (when status is `processing`)

## Example

```bash cURL
curl -X POST "https://api.tensorone.ai/v2/ai/text-to-video" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A majestic eagle soaring over snow-capped mountains at sunset, cinematic camera movement following the eagle, golden hour lighting",
    "model": "zeroscope-v2",
    "duration": 5.0,
    "fps": 12,
    "width": 1024,
    "height": 576,
    "steps": 30,
    "guidanceScale": 9.0,
    "motionStrength": 0.8,
    "stylePreset": "cinematic"
  }'
```

```python Python
import requests
import time

# Generate video
response = requests.post(
    "https://api.tensorone.ai/v2/ai/text-to-video",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "A cat playing with a ball of yarn in a cozy living room, soft natural lighting, shot with cinematic depth of field",
        "model": "zeroscope-v2",
        "duration": 4.0,
        "fps": 8,
        "width": 1024,
        "height": 576,
        "stylePreset": "realistic",
        "motionStrength": 0.6
    }
)

video_data = response.json()
video_id = video_data['videoId']
print(f"Video generation started: {video_id}")
print(f"Estimated completion: {video_data['estimatedCompletionTime']}")

# Poll for completion
while True:
    status_response = requests.get(
        f"https://api.tensorone.ai/v2/ai/videos/{video_id}/status",
        headers={"Authorization": "Bearer YOUR_API_KEY"}
    )
    
    status = status_response.json()
    
    if status['status'] == 'completed':
        print(f"Video ready: {status['videoUrl']}")
        break
    elif status['status'] == 'failed':
        print("Video generation failed")
        break
    else:
        print(f"Status: {status['status']}")
        time.sleep(30)  # Check every 30 seconds
```

```javascript JavaScript
const response = await fetch('https://api.tensorone.ai/v2/ai/text-to-video', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prompt: 'A time-lapse of a flower blooming in a garden, macro lens, vibrant colors',
    model: 'zeroscope-v2',
    duration: 3.0,
    fps: 12,
    stylePreset: 'artistic',
    motionStrength: 0.9
  })
});

const videoData = await response.json();
console.log('Video generation started:', videoData.videoId);

// Monitor progress
const checkStatus = async (videoId) => {
  const statusResponse = await fetch(`https://api.tensorone.ai/v2/ai/videos/${videoId}/status`, {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  
  const status = await statusResponse.json();
  return status;
};

// Poll until complete
const pollStatus = async (videoId) => {
  while (true) {
    const status = await checkStatus(videoId);
    
    if (status.status === 'completed') {
      console.log('Video URL:', status.videoUrl);
      break;
    }
    
    await new Promise(resolve => setTimeout(resolve, 30000));
  }
};

pollStatus(videoData.videoId);
```

```json Response
{
  "videoId": "vid_abc123_def456",
  "status": "queued",
  "estimatedCompletionTime": "3-5 minutes",
  "resolution": {
    "width": 1024,
    "height": 576,
    "fps": 12
  },
  "duration": 5.0,
  "metadata": {
    "model": "zeroscope-v2",
    "steps": 30,
    "guidanceScale": 9.0
  },
  "createdAt": "2024-01-16T14:30:00Z"
}
```

```json Completed Video Response
{
  "videoId": "vid_abc123_def456",
  "status": "completed",
  "videoUrl": "https://videos.tensorone.ai/generated/vid_abc123_def456.mp4",
  "thumbnailUrl": "https://videos.tensorone.ai/thumbnails/vid_abc123_def456.jpg",
  "duration": 5.0,
  "resolution": {
    "width": 1024,
    "height": 576,
    "fps": 12
  },
  "metadata": {
    "model": "zeroscope-v2",
    "steps": 30,
    "guidanceScale": 9.0,
    "generationTime": 245.6,
    "seed": 1234567890
  },
  "createdAt": "2024-01-16T14:30:00Z",
  "completedAt": "2024-01-16T14:34:05Z"
}
```

## Video Status Tracking

Track video generation progress:

```bash cURL
curl -X GET "https://api.tensorone.ai/v2/ai/videos/vid_abc123_def456/status" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python Python
# Check video status
def check_video_status(video_id):
    response = requests.get(
        f"https://api.tensorone.ai/v2/ai/videos/{video_id}/status",
        headers={"Authorization": "Bearer YOUR_API_KEY"}
    )
    return response.json()

status = check_video_status("vid_abc123_def456")
print(f"Status: {status['status']}")

if status['status'] == 'processing':
    print(f"Progress: {status.get('progress', 0)}%")
```

## Advanced Prompting Techniques

### Camera Movements

```
"A serene lake at dawn with camera slowly panning from left to right, revealing mountains in the background"
"Close-up shot of a rose with camera pulling back to reveal a garden, cinematic zoom out"
"Tracking shot following a bird flying through a forest, smooth camera movement"
```

### Scene Transitions

```
"Morning coffee being poured into a cup, steam rising, time-lapse of the day passing through the window"
"A seed being planted, time-lapse of it growing into a tree, seasons changing"
"City street during day transitioning to night with lights turning on"
```

### Action Sequences

```
"Waves crashing against rocks on a stormy coastline, dramatic water movement, high-speed capture"
"Dancer performing ballet moves in a studio, graceful movements, slow motion"
"Chef preparing a meal, hands moving quickly, dynamic cooking actions"
```

### Style Modifiers

```
"[scene description], shot with vintage 35mm film camera, grain and warm color grading"
"[scene description], anime style animation, vibrant colors, Studio Ghibli aesthetic"
"[scene description], cyberpunk aesthetic, neon lights, futuristic atmosphere"
```

## Video Upscaling

Upscale generated videos to higher resolution:

```python Python
# Upscale video to 4K
upscale_response = requests.post(
    "https://api.tensorone.ai/v2/ai/video-upscale",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "videoId": "vid_abc123_def456",
        "targetResolution": "4K",  # 1080p, 4K
        "enhanceDetails": True,
        "stabilizeMotion": True
    }
)

upscaled_video = upscale_response.json()
print(f"Upscaling started: {upscaled_video['upscaleId']}")
```

## Custom Models and LoRA

Use custom trained models for specific styles:

```python Python
# Use custom LoRA for specific style
response = requests.post(
    "https://api.tensorone.ai/v2/ai/text-to-video",
    json={
        "prompt": "A knight on horseback riding through a medieval village",
        "model": "zeroscope-v2",
        "loraModels": [
            {
                "loraId": "lora_medieval_style_123",
                "weight": 0.8
            }
        ],
        "duration": 4.0
    }
)
```

## Batch Video Generation

Generate multiple videos in batch:

```python Python
# Generate multiple variations
batch_prompts = [
    "A cat sitting by a window watching rain",
    "A cat playing with a toy mouse indoors",
    "A cat sleeping peacefully on a couch"
]

video_ids = []
for prompt in batch_prompts:
    response = requests.post(
        "https://api.tensorone.ai/v2/ai/text-to-video",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        json={
            "prompt": prompt,
            "model": "zeroscope-v2",
            "duration": 3.0,
            "seed": None  # Random seed for variation
        }
    )
    
    video_ids.append(response.json()['videoId'])

print(f"Started generation of {len(video_ids)} videos")
```

## Video Formats and Download

Generated videos are available in multiple formats:

* **MP4**: Standard format with H.264 encoding
* **WebM**: Web-optimized format
* **GIF**: Animated GIF for web use (limited duration)

```python
# Download video in different formats
formats = ['mp4', 'webm', 'gif']

for format_type in formats:
    download_url = f"https://api.tensorone.ai/v2/ai/videos/{video_id}/download?format={format_type}"
    
    response = requests.get(
        download_url,
        headers={"Authorization": "Bearer YOUR_API_KEY"}
    )
    
    with open(f'generated_video.{format_type}', 'wb') as f:
        f.write(response.content)
```

## Pricing

* **Standard Generation**: \$0.50 per second of video (up to 1024x576)
* **High Resolution**: \$1.00 per second (above 1024x576)
* **Long Form**: \$0.30 per second for videos longer than 10 seconds
* **Upscaling**: \$0.25 per second for resolution enhancement

## Best Practices

* **Be Specific**: Include details about camera movement, lighting, and style
* **Optimize Duration**: Shorter videos (3-5 seconds) generate faster and cost less
* **Motion Control**: Adjust `motionStrength` based on desired level of action
* **Quality Settings**: Use higher steps (25-35) for final productions
* **Seed Management**: Save seeds for consistent style across multiple videos
* **Format Selection**: Use MP4 for highest quality, WebM for web, GIF for social media

> [!NOTE]
>
> Video generation typically takes 2-5 minutes depending on duration, resolution, and complexity. Longer videos may take up to 10 minutes to complete.

> [!TIP]
>
> For best results, describe the scene, action, camera movement, and visual style in your prompt. The more specific your description, the better the generated video will match your vision.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.