Skip to main content

Overview

Image to Video converts static images into dynamic video content with AI-generated motion and cinematic effects. The API analyzes images and creates realistic movement, camera motion, and environmental effects to bring still photos to life.

How It Works

  1. Provide a source image - Upload the image you want to animate
  2. Describe the motion - Use a text prompt to describe how it should move
  3. API generates the video - AI creates natural motion and effects
  4. Download the result - Retrieve your animated video

Use Cases

  • Social media content - Turn photos into engaging video posts
  • Marketing videos - Create dynamic content from product photos
  • Storytelling - Bring static images to life for narratives
  • Real estate - Animate property photos for virtual tours
  • E-commerce - Dynamic product showcases

Best Practices

Source Image Quality

Use high-quality images with clear subjects - Better images produce smoother, more realistic animations.
  • High resolution - At least 720p for best results
  • Clear subjects - Well-defined elements animate better
  • Good composition - Leave “room” for motion in your frame
  • Appropriate content - Images with implied motion work well

Motion Prompts

Describe the motion you want to see: ✅ Good prompts:
  • “Camera slowly panning right, leaves gently swaying in wind”
  • “Zoom in on the subject with slight parallax effect”
  • “Water rippling, clouds moving slowly across the sky”
  • “Person walking forward, hair blowing in breeze”
❌ Avoid:
  • No motion description: “A beautiful landscape”
  • Impossible physics: “Person flying through wall”
  • Conflicting motions: “Zoom in and zoom out simultaneously”

Image Types That Animate Well

Image TypeAnimation PotentialTips
LandscapesExcellentAdd wind, water, cloud motion
PortraitsGoodSubtle movements, blinks, breathing
Product photosModerateCamera motion, lighting effects
Abstract artExcellentMorphing, flowing effects

Code Examples

Basic Image to Video

from magic_hour import Client
import os

client = Client(token=os.getenv("MAGIC_HOUR_API_KEY"))

result = client.v1.image_to_video.generate(
    assets={
        "image_file_path": "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/sunset.jpg"
    },
    style={
        "prompt":  "Sunset landscape with subtle parallax effect while panning, clouds moving cinematic depth"
    },
    end_seconds=5,
    name="Sunset Animation",
    resolution="480p",
    wait_for_completion=True,
    download_outputs=True,
    download_directory="./outputs/"
)

if result.status == "complete":
    print(f"✅ Video complete!")
    print(f"Downloaded to: {result.downloaded_paths}")
    print(f"Credits charged: {result.credits_charged}")
else:
    print(f"❌ Job failed with status: {result.status}")
    if hasattr(result, 'error_message'):
        print(f"Error: {result.error_message}")

Pricing

Image to Video uses credits based on video duration:
DurationApproximate Credits
5 seconds~150 credits
10 seconds~300 credits
Higher resolutions cost more per second.

Resolution Limits

Image to Video has a maximum resolution of 1080p (1920x1080 or 1080x1920).
Try this in our Google Colab Cookbook: Run this API with sample code. Just add your API key.

API Reference

Image to Video API Reference

View full API specification