mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-08 05:17:02 +08:00
Manually add BFL polling status response schema (#15)
This commit is contained in:
parent
835a6a0f21
commit
d46c911451
29
comfy_api_nodes/apis/BFLPolling.py
Normal file
29
comfy_api_nodes/apis/BFLPolling.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from enum import Enum
|
||||||
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
|
from pydantic import BaseModel, Field, confloat
|
||||||
|
|
||||||
|
|
||||||
|
class BFLStatus(str, Enum):
|
||||||
|
task_not_found = "Task not found"
|
||||||
|
pending = "Pending"
|
||||||
|
request_moderated = "Request Moderated"
|
||||||
|
content_moderated = "Content Moderated"
|
||||||
|
ready = "Ready"
|
||||||
|
error = "Error"
|
||||||
|
|
||||||
|
|
||||||
|
class BFLFluxProStatusResponse(BaseModel):
|
||||||
|
id: str = Field(..., description="The unique identifier for the generation task.")
|
||||||
|
status: BFLStatus = Field(..., description="The status of the task.")
|
||||||
|
result: Optional[Dict[str, Any]] = Field(
|
||||||
|
None, description="The result of the task (null if not completed)."
|
||||||
|
)
|
||||||
|
progress: confloat(ge=0.0, le=1.0) = Field(
|
||||||
|
..., description="The progress of the task (0.0 to 1.0)."
|
||||||
|
)
|
||||||
|
details: Optional[Dict[str, Any]] = Field(
|
||||||
|
None, description="Additional details about the task (null if not available)."
|
||||||
|
)
|
||||||
@ -42,15 +42,6 @@ class BFLFluxProGenerateResponse(BaseModel):
|
|||||||
polling_url: str = Field(..., description='URL to poll for the generation result.')
|
polling_url: str = Field(..., description='URL to poll for the generation result.')
|
||||||
|
|
||||||
|
|
||||||
class BFLStatus(str, Enum):
|
|
||||||
task_not_found = "Task not found"
|
|
||||||
pending = "Pending"
|
|
||||||
request_moderated = "Request Moderated"
|
|
||||||
content_moderated = "Content Moderated"
|
|
||||||
ready = "Ready"
|
|
||||||
error = "Error"
|
|
||||||
|
|
||||||
|
|
||||||
class ErrorResponse(BaseModel):
|
class ErrorResponse(BaseModel):
|
||||||
error: str
|
error: str
|
||||||
message: str
|
message: str
|
||||||
|
|||||||
@ -20,10 +20,10 @@ from comfy_api_nodes.apis import (
|
|||||||
IdeogramGenerateResponse,
|
IdeogramGenerateResponse,
|
||||||
BFLFluxProGenerateRequest,
|
BFLFluxProGenerateRequest,
|
||||||
BFLFluxProGenerateResponse,
|
BFLFluxProGenerateResponse,
|
||||||
BFLStatus,
|
|
||||||
ImageRequest,
|
ImageRequest,
|
||||||
Model
|
Model
|
||||||
)
|
)
|
||||||
|
from comfy_api_nodes.apis.BFLPolling import BFLStatus
|
||||||
from comfy_api_nodes.apis.client import ApiEndpoint, HttpMethod, SynchronousOperation, PollingOperation, EmptyRequest
|
from comfy_api_nodes.apis.client import ApiEndpoint, HttpMethod, SynchronousOperation, PollingOperation, EmptyRequest
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user