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
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')
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/wan2.1-i2v-480p"
# Request payload
data = {
"prompt": "A shady looking man in a trench coat glances nervously from side to side. He slowly reaches up to the side of his face and opens it up like a door, revealing a tiny alien inside his head who is piloting him by pulling various levers. The tiny alien is also wearing a trench coat and glances nervously from side to side. Also this entire scene takes place in the bleachers at a rodeo.",
"negative_prompt": "blurry, bad quality, camera shake, distortion, poor composition, low resolution, artifact, watermark",
"image": image_url_to_base64("https://segmind-resources.s3.amazonaws.com/input/e654c0e4-f048-4450-b289-e37280210c3e-wan-480-ip.png"), # Or use image_file_to_base64("IMAGE_PATH")
"seed": 30887452,
"video_length": 3,
"resolution": 480,
"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
Prompt for video generation
Negative prompt for video generation
Reference image for video generation
Seed number for video generation
Length of the generated video in seconds
min : 1,
max : 5
Resolution of the generated video (longest side of the 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 is a cutting-edge video foundation model that excels in image-to-video generation 480p and outperforms existing open-source and state-of-the-art commercial solutions
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).
Data: Trained on a vast amount of curated and deduplicated image and video data, processed through a four-step data cleaning process.
The models are licensed under the Apache 2.0 License, granting freedom of use while ensuring compliance with the license provisions.
The model is capable of generating videos at 720P resolution; however, the results are generally less stable compared to 480P due to limited training at that resolution. It is recommended to use 480P resolution for optimal performance.
Extensive manual evaluations confirm that Wan2.1 outperforms both closed-source and open-source models
SDXL ControlNet gives unprecedented control over text-to-image generation. SDXL ControlNet models Introduces the concept of conditioning inputs, which provide additional information to guide the image generation process
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training