mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
34402cc46a
- add `list_images` endpoint at `GET api/v1/images` - extend `ImageStorageBase` with `list()` method, implemented it for `DiskImageStorage` - add `ImageReponse` class to for image responses, which includes urls, metadata - add `ImageMetadata` class (basically a stub at the moment) - uploaded images now named `"{uuid}_{timestamp}.png"` - add `models` modules. besides separating concerns more clearly, this helps to mitigate circular dependencies - improve thumbnail handling
15 lines
566 B
Python
15 lines
566 B
Python
from pydantic import BaseModel, Field
|
|
|
|
from invokeai.app.models.image import ImageType
|
|
from invokeai.app.models.metadata import ImageMetadata
|
|
|
|
|
|
class ImageResponse(BaseModel):
|
|
"""The response type for images"""
|
|
|
|
image_type: ImageType = Field(description="The type of the image")
|
|
image_name: str = Field(description="The name of the image")
|
|
image_url: str = Field(description="The url of the image")
|
|
thumbnail_url: str = Field(description="The url of the image's thumbnail")
|
|
metadata: ImageMetadata = Field(description="The image's metadata")
|