mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-05 18:05:08 +08:00
Amp-Thread-ID: https://ampcode.com/threads/T-019fca67-53e6-76d6-8561-0bb1b07473d1 Co-authored-by: Amp <amp@ampcode.com>
32 lines
814 B
Python
32 lines
814 B
Python
from typing import Literal
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
ComfyCloudWorkflow = Literal["text-to-image", "text-to-video", "image-to-video", "image-edit"]
|
|
|
|
|
|
class ComfyCloudWorkflowInputs(BaseModel):
|
|
prompt: str = Field(...)
|
|
image_url: str | None = Field(None)
|
|
|
|
|
|
class ComfyCloudGenerateRequest(BaseModel):
|
|
workflow: ComfyCloudWorkflow = Field(...)
|
|
inputs: ComfyCloudWorkflowInputs = Field(...)
|
|
|
|
|
|
class ComfyCloudGenerateResponse(BaseModel):
|
|
task_id: str = Field(...)
|
|
status: str = Field(...)
|
|
polling_url: str = Field(...)
|
|
cancel_url: str = Field(...)
|
|
|
|
|
|
class ComfyCloudStatusResponse(BaseModel):
|
|
task_id: str = Field(...)
|
|
status: str = Field(...)
|
|
progress: float | None = Field(None)
|
|
output_url: str | None = Field(None)
|
|
error: str | None = Field(None)
|