cddb07a176
docs / deploy (push) Has been cancelled
docs / changes (push) Has been cancelled
docs / check-and-build (push) Has been cancelled
build container image / cpu (push) Has been cancelled
build container image / cuda (push) Has been cancelled
build container image / rocm (push) Has been cancelled
frontend checks / frontend-checks (push) Has been cancelled
frontend tests / frontend-tests (push) Has been cancelled
lfs checks / lfs-check (push) Has been cancelled
python checks / python-checks (push) Has been cancelled
python tests / py3.12: macos-default (push) Has been cancelled
python tests / py3.11: windows-cpu (push) Has been cancelled
python tests / py3.12: windows-cpu (push) Has been cancelled
python tests / py3.11: linux-cpu (push) Has been cancelled
typegen checks / typegen-checks (push) Has been cancelled
uv lock checks / uv-lock-checks (push) Has been cancelled
openapi checks / openapi-checks (push) Has been cancelled
python tests / py3.11: macos-default (push) Has been cancelled
python tests / py3.12: linux-cpu (push) Has been cancelled
53 lines
1.3 KiB
Python
53 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
from typing import Any
|
|
|
|
from PIL.Image import Image as PILImageType
|
|
|
|
from invokeai.backend.model_manager.configs.external_api import ExternalApiModelConfig, ExternalGenerationMode
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ExternalReferenceImage:
|
|
image: PILImageType
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ExternalGenerationRequest:
|
|
model: ExternalApiModelConfig
|
|
mode: ExternalGenerationMode
|
|
prompt: str
|
|
seed: int | None
|
|
num_images: int
|
|
width: int
|
|
height: int
|
|
image_size: str | None
|
|
init_image: PILImageType | None
|
|
mask_image: PILImageType | None
|
|
reference_images: list[ExternalReferenceImage]
|
|
metadata: dict[str, Any] | None
|
|
provider_options: dict[str, Any] | None = None
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ExternalGeneratedImage:
|
|
image: PILImageType
|
|
seed: int | None = None
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ExternalGenerationResult:
|
|
images: list[ExternalGeneratedImage]
|
|
seed_used: int | None = None
|
|
provider_request_id: str | None = None
|
|
provider_metadata: dict[str, Any] | None = None
|
|
content_filters: dict[str, str] | None = None
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ExternalProviderStatus:
|
|
provider_id: str
|
|
configured: bool
|
|
message: str | None = None
|