Downloads · 30 days
0
bernardlcs/wan-video-worker
wan-video-worker is a machine learning model from bernardlcs. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Custom handler para deploy do modelo Wan-AI/Wan2.2-I2V-A14B-Diffusers em HuggingFace Inference Endpoints.
Downloads · 30 days
0
Access
Public
Updated Feb 2, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py4.7 KB · 48%
From the Hugging Face model README
Custom handler para deploy do modelo Wan-AI/Wan2.2-I2V-A14B-Diffusers em HuggingFace Inference Endpoints.
.
├── handler.py # EndpointHandler customizado
├── requirements.txt # Dependências Python
└── README.md # Esta documentação
handler.py (auto-detectado)/health (padrão){
"inputs": {
"image": "https://example.com/image.jpg",
"prompt": "A beautiful sunset",
"negative_prompt": "blurry, low quality",
"num_inference_steps": 30,
"guidance_scale": 7.5,
"num_frames": 81,
"fps": 8,
"width": 768,
"height": 768,
"seed": 42
}
}
| Parameter | Type | Default | Description |
|---|---|---|---|
image | string | required | URL ou base64 da imagem inicial |
prompt | string | "" | Descrição do movimento desejado |
negative_prompt | string | "" | O que evitar no vídeo |
num_inference_steps | int | 30 | Qualidade (20-50) |
guidance_scale | float | 7.5 | Aderência ao prompt (5-15) |
num_frames | int | 81 | Total de frames (49, 81, 113) |
fps | int | 8 | Frames por segundo |
width | int | 768 | Largura do vídeo |
height | int | 768 | Altura do vídeo |
seed | int | 42 | Seed para reprodutibilidade |
{
"video": "base64_encoded_mp4_string",
"format": "mp4",
"frames": 81,
"fps": 8,
"width": 768,
"height": 768
}
import requests
import base64
endpoint_url = "https://your-endpoint.endpoints.huggingface.cloud"
headers = {
"Authorization": "Bearer YOUR_HF_TOKEN",
"Content-Type": "application/json"
}
payload = {
"inputs": {
"image": "https://example.com/sample.jpg",
"prompt": "slow motion waves on the beach",
"num_inference_steps": 30,
"num_frames": 81,
"fps": 8
}
}
response = requests.post(endpoint_url, headers=headers, json=payload)
result = response.json()
# Salvar vídeo
video_data = base64.b64decode(result["video"])
with open("output.mp4", "wb") as f:
f.write(video_data)
| GPU | VRAM | Custo/hora | Tempo/vídeo | Custo/vídeo |
|---|---|---|---|---|
| A100 (80GB) | 80GB | ~$1.30 | ~2 min | ~$0.04 |
| H100 (80GB) | 80GB | ~$2.50 | ~1 min | ~$0.04 |
O handler implementa:
num_frames para 49width/height para 512data:image/...Este handler é baseado no modelo WanVideo 2.2 da Wan-AI. Consulte a licença do modelo original para termos de uso.