API
If you're looking for an API, you can choose from your desired programming language.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/wan2.1-t2v"
# Request payload
data = {
"prompt": "A smiling woman walking in London at night",
"negative_prompt": "blurry, bad quality, camera shake, distortion, poor composition, low resolution, artifact, watermark",
"seed": 9604478,
"video_length": 3,
"base_model": "14b",
"aspect_ratio": "16:9",
"steps": 30,
"base64": False
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
Prompt for video generation
Negative prompt for video generation
Seed number for video generation
Length of the generated video in seconds
min : 1,
max : 5
Base model for video generation
Allowed values:
Aspect Ratio of the output video
Allowed values:
Number of steps for video generation
min : 10,
max : 70
Output as base64
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Wan2.1 Text to Video
Wan2.1 is a cutting-edge suite of video foundation models that excels in text-to-video (T2V) generation, pushing the boundaries of what's possible. It consistently outperforms existing open-source and commercial solutions across multiple benchmarks.
Key Features of Wan2.1 Text to Video
-
SOTA Performance: Consistently outperforms existing open-source and commercial models across multiple benchmarks.
-
Powerful Video VAE: Wan-VAE delivers exceptional efficiency and performance, encoding and decoding 1080P videos of any length while preserving temporal information.
-
Architecture: Designed on the mainstream diffusion transformer paradigm with innovations like a novel spatio-temporal variational autoencoder (VAE).
-
T2V-14B: Supports both 480P and 720P resolutions. It establishes a new SOTA performance benchmark.
-
T2V-1.3B: Supports 480P resolution. While capable of generating videos at 720P, the 480P resolution provides more stable results
Additional Information
-
The models are licensed under the Apache 2.0 License, granting freedom of use while ensuring compliance with the license provisions.
-
Extensive manual evaluations confirm that Wan2.1 outperforms both closed-source and open-source models
Other Popular Models
storydiffusion
Story Diffusion turns your written narratives into stunning image sequences.

fooocus
Fooocus enables high-quality image generation effortlessly, combining the best of Stable Diffusion and Midjourney.

instantid
InstantID aims to generate customized images with various poses or styles from only a single reference ID image while ensuring high fidelity

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.
