mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-31 03:17:23 +08:00
Some checks failed
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
"""Pydantic models for the Krea image-generation API."""
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class KreaMoodboard(BaseModel):
|
|
id: str = Field(...)
|
|
strength: float = Field(default=0.35, ge=-0.5, le=1.5)
|
|
|
|
|
|
class KreaImageStyleReference(BaseModel):
|
|
strength: float = Field(..., ge=-2.0, le=2.0)
|
|
url: str | None = Field(default=None)
|
|
|
|
|
|
class KreaGenerateImageRequest(BaseModel):
|
|
prompt: str = Field(...)
|
|
aspect_ratio: str = Field(...)
|
|
resolution: str = Field(...)
|
|
seed: int | None = Field(default=None)
|
|
creativity: str = Field(default="medium")
|
|
moodboards: list[KreaMoodboard] | None = Field(default=None)
|
|
image_style_references: list[KreaImageStyleReference] | None = Field(default=None)
|
|
|
|
|
|
class KreaJobResult(BaseModel):
|
|
urls: list[str] | None = Field(default=None)
|
|
style_id: str | None = Field(default=None)
|
|
|
|
|
|
class KreaJob(BaseModel):
|
|
job_id: str = Field(...)
|
|
status: str = Field(...)
|
|
created_at: str = Field(...)
|
|
completed_at: str | None = Field(default=None)
|
|
result: KreaJobResult | None = Field(default=None)
|
|
|
|
|
|
class KreaAssetResponse(BaseModel):
|
|
id: str = Field(...)
|
|
image_url: str = Field(...)
|
|
uploaded_at: str = Field(...)
|
|
width: float | None = Field(default=None)
|
|
height: float | None = Field(default=None)
|
|
size_bytes: float | None = Field(default=None)
|
|
mime_type: str | None = Field(default=None)
|