Views
No views yet
.
├── handler.py # EndpointHandler customizado
├── requirements.txt # Dependências Python
└── README.md # Esta documentaçãohandler.py (auto-detectado)/health (padrão)1{
2 "inputs": {
3 "image": "https://example.com/image.jpg",
4 "prompt": "A beautiful sunset",
5 "negative_prompt": "blurry, low quality",
6 "num_inference_steps": 30,
7 "guidance_scale": 7.5,
8 "num_frames": 81,
9 "fps": 8,
10 "width": 768,
11 "height": 768,
12 "seed": 42
13 }
14}| 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 |
1{
2 "video": "base64_encoded_mp4_string",
3 "format": "mp4",
4 "frames": 81,
5 "fps": 8,
6 "width": 768,
7 "height": 768
8}1import requests
2import base64
3
4endpoint_url = "https://your-endpoint.endpoints.huggingface.cloud"
5headers = {
6 "Authorization": "Bearer YOUR_HF_TOKEN",
7 "Content-Type": "application/json"
8}
9
10payload = {
11 "inputs": {
12 "image": "https://example.com/sample.jpg",
13 "prompt": "slow motion waves on the beach",
14 "num_inference_steps": 30,
15 "num_frames": 81,
16 "fps": 8
17 }
18}
19
20response = requests.post(endpoint_url, headers=headers, json=payload)
21result = response.json()
22
23# Salvar vídeo
24video_data = base64.b64decode(result["video"])
25with open("output.mp4", "wb") as f:
26 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 |
num_frames para 49width/height para 512data:image/...