Skip to content

Commit 393d288

Browse files
authored
feat(api-nodes): added nodes for Vidu2 (Comfy-Org#11760)
1 parent 4484b93 commit 393d288

File tree

2 files changed

+482
-147
lines changed

2 files changed

+482
-147
lines changed

comfy_api_nodes/apis/vidu.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from pydantic import BaseModel, Field
2+
3+
4+
class SubjectReference(BaseModel):
5+
id: str = Field(...)
6+
images: list[str] = Field(...)
7+
8+
9+
class TaskCreationRequest(BaseModel):
10+
model: str = Field(...)
11+
prompt: str = Field(..., max_length=2000)
12+
duration: int = Field(...)
13+
seed: int = Field(..., ge=0, le=2147483647)
14+
aspect_ratio: str | None = Field(None)
15+
resolution: str | None = Field(None)
16+
movement_amplitude: str | None = Field(None)
17+
images: list[str] | None = Field(None, description="Base64 encoded string or image URL")
18+
subjects: list[SubjectReference] | None = Field(None)
19+
bgm: bool | None = Field(None)
20+
audio: bool | None = Field(None)
21+
22+
23+
class TaskCreationResponse(BaseModel):
24+
task_id: str = Field(...)
25+
state: str = Field(...)
26+
created_at: str = Field(...)
27+
code: int | None = Field(None, description="Error code")
28+
29+
30+
class TaskResult(BaseModel):
31+
id: str = Field(..., description="Creation id")
32+
url: str = Field(..., description="The URL of the generated results, valid for one hour")
33+
cover_url: str = Field(..., description="The cover URL of the generated results, valid for one hour")
34+
35+
36+
class TaskStatusResponse(BaseModel):
37+
state: str = Field(...)
38+
err_code: str | None = Field(None)
39+
progress: float | None = Field(None)
40+
credits: int | None = Field(None)
41+
creations: list[TaskResult] = Field(..., description="Generated results")

0 commit comments

Comments
 (0)