00:00 / 00:00
![import requests
import json
url = "https://api.minimax.chat/v1/video_generation"
api_key="请填写您的api_key"
your_file_path = "" # 在此填写图片文件路径
#base64编码形式输入
with open(your_file_path, "rb") as image_file:
data = base64.b64encode(image_file.read()).decode('utf-8')
payload = json.dumps({
"model": "I2V-01-Director",
"prompt": "男子拿起一本书[上升],然后阅读[固定]。",
"first_frame_image": f"data:image/jpeg;base64,{data}"
})
headers = {
'authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text) by Hailuo AI Video Generator](https://cdn.hailuoai.com/prod/2025-03-06-23/video_cover/1741275368053523593-cover_25c1b44164ff6e540950965cb36493db.jpeg?x-oss-process=image/resize,w_540/format,webp)

创意描述
复制
import requests
import json
url = "https://api.minimax.chat/v1/video_generation"
api_key="请填写您的api_key"
your_file_path = "" # 在此填写图片文件路径
#base64编码形式输入
with open(your_file_path, "rb") as image_file:
data = base64.b64encode(image_file.read()).decode('utf-8')
payload = json.dumps({
"model": "I2V-01-Director",
"prompt": "男子拿起一本书[上升],然后阅读[固定]。",
"first_frame_image": f"data:image/jpeg;base64,{data}"
})
headers = {
'authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Hailuo 01-Director
提示词优化
720p
内容由AI生成