Download I2v from Perry1323/Min: direct link, hf CLI and curl.
- Browser
- Download file 596 Bytes
-
https://huggingface.co/Perry1323/Min/resolve/main/I2v
- Command line
-
hf download hf://Perry1323/Min/I2v
-
curl -L -o I2v https://huggingface.co/Perry1323/Min/resolve/main/I2v
596 Bytes
| import requests | |
| import json | |
| import base64 | |
| url = "https://api.minimaxi.chat/v1/video_generation" | |
| api_key="your api_key" | |
| #base64 | |
| with open(f"your_file_path", "rb") as image_file: | |
| data = base64.b64encode(image_file.read()).decode('utf-8') | |
| payload = json.dumps({ | |
| "model": "video-01", | |
| "prompt": "On a distant planet, there is a MiniMax.", | |
| "first_frame_image":f"data:image/jpeg;base64,{image_file}" | |
| }) | |
| headers = { | |
| 'authorization': f'Bearer {api_key}', | |
| 'Content-Type': 'application/json' | |
| } | |
| response = requests.request("POST", url, headers=headers, data=payload) | |
| print(response.text) | |