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
12 lines
486 B
Python
12 lines
486 B
Python
from typing import Optional
|
|
from pydantic import BaseModel, Field
|
|
|
|
class ImageMetadata(BaseModel):
|
|
"""An image's metadata"""
|
|
|
|
timestamp: float = Field(description="The creation timestamp of the image")
|
|
width: int = Field(description="The width of the image in pixels")
|
|
height: int = Field(description="The height of the image in pixels")
|
|
# TODO: figure out metadata
|
|
sd_metadata: Optional[dict] = Field(default={}, description="The image's SD-specific metadata")
|