Manually add BFL polling status response schema (#15)

This commit is contained in:
Christian Byrne 2025-04-28 15:17:57 -07:00 committed by Robin Huang
parent c6d9c77e86
commit f29a3194b4
2 changed files with 30 additions and 1 deletions

View 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)."
)

View File

@ -16,10 +16,10 @@ from comfy_api_nodes.apis import (
IdeogramGenerateResponse,
BFLFluxProGenerateRequest,
BFLFluxProGenerateResponse,
BFLStatus,
ImageRequest,
Model
)
from comfy_api_nodes.apis.BFLPolling import BFLStatus
from comfy_api_nodes.apis.client import ApiEndpoint, HttpMethod, SynchronousOperation, PollingOperation, EmptyRequest
import numpy as np