mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-05 06:57:05 +08:00
Manually add BFL polling status response schema (#15)
This commit is contained in:
parent
c6d9c77e86
commit
f29a3194b4
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)."
|
||||||
|
)
|
||||||
@ -16,10 +16,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