| import base64 |
| import json |
| from handler import EndpointHandler |
| from PIL import Image |
| import io |
|
|
| |
| handler = EndpointHandler() |
|
|
| |
| inputs = { |
| "inputs": { |
| "ref_image_url": "https://cdn.discordapp.com/attachments/1237667074210267217/1246572710679806003/image.jpg?ex=665ce0ce&is=665b8f4e&hm=b8a0caf3080336aac412746681efb7189d5cb4c3e2c0b8ea52696402bbb82a91&", |
| "video_url": "https://cdn.discordapp.com/attachments/1237667074210267217/1246572710964756593/pose.mp4?ex=665ce0ce&is=665b8f4e&hm=32748799cab55da4040143c5449f497c1440ecd13ba9886e6b12648e1d72e9fc&", |
| "length": 24, |
| "num_inference_steps": 25, |
| "cfg": 3.5, |
| "seed": 123 |
| } |
| } |
|
|
| |
| output = handler(inputs) |
|
|
| |
| video_base64 = output.get("video", "") |
| video_bytes = base64.b64decode(video_base64) |
|
|
| |
| with open("output_video.mp4", "wb") as video_file: |
| video_file.write(video_bytes) |
|
|
| print("Inference completed. Output video saved as output_video.mp4") |
|
|