图片增加最大上传个数
This commit is contained in:
@@ -44,5 +44,6 @@ async def list_active_engines(
|
||||
"supported_models": models,
|
||||
"supported_sizes": sizes,
|
||||
"default_size": e.default_size,
|
||||
"max_image_count": e.max_image_count,
|
||||
})
|
||||
return {"items": items}
|
||||
@@ -17,6 +17,7 @@ class ImageEngine(Base, TimestampMixin):
|
||||
# {"2K":{"1:1":"2048×2048",...}, "4K":{"1:1":"4096×4096",...}}
|
||||
supported_sizes: Mapped[str] = mapped_column(Text, default='{}')
|
||||
default_size: Mapped[str] = mapped_column(String(32), default="2K")
|
||||
max_image_count: Mapped[int] = mapped_column(Integer, default=0)
|
||||
generate_url: Mapped[str | None] = mapped_column(String(512), nullable=True, default="")
|
||||
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
||||
priority: Mapped[int] = mapped_column(Integer, default=0)
|
||||
|
||||
@@ -168,6 +168,7 @@ class GenerationAIImageEngineOptionOut(BaseModel):
|
||||
)
|
||||
default_size: str | None = Field(None, description="默认图片分辨率档位,例如 2K")
|
||||
priority: int = Field(0, description="引擎优先级,数值越大越优先")
|
||||
max_image_count: int = Field(0, description="最大图片数量")
|
||||
|
||||
|
||||
class GenerationAIVideoEngineOptionOut(BaseModel):
|
||||
|
||||
@@ -12,6 +12,7 @@ class ImageEngineCreate(BaseModel):
|
||||
supported_models: str = Field(default='["doubao-seedream-5-0-260128"]')
|
||||
supported_sizes: str = Field(default='{}')
|
||||
default_size: str = Field(default="2K", max_length=32)
|
||||
max_image_count: int = Field(default=0)
|
||||
generate_url: str = Field(default="", max_length=512)
|
||||
is_active: bool = True
|
||||
priority: int = 0
|
||||
@@ -31,6 +32,7 @@ class ImageEnginePublic(BaseModel):
|
||||
supported_models: list[str] = []
|
||||
supported_sizes: dict[str, dict[str, str]] = {}
|
||||
default_size: str = "2K"
|
||||
max_image_count: int = 0
|
||||
|
||||
|
||||
class ImageEngineListResponse(BaseModel):
|
||||
|
||||
@@ -186,6 +186,7 @@ async def list_generation_ai_engine_options(db: AsyncSession) -> GenerationAIEng
|
||||
supported_sizes=_image_supported_sizes(engine),
|
||||
default_size=engine.default_size,
|
||||
priority=engine.priority or 0,
|
||||
max_image_count=engine.max_image_count,
|
||||
)
|
||||
for engine in image_result.scalars().all()
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user