use webp images

This commit is contained in:
Jennifer Player
2024-03-06 13:53:05 -05:00
committed by Kent Keirsey
parent 8411029d93
commit aa88fadc30
8 changed files with 88 additions and 78 deletions

View File

@ -287,21 +287,18 @@ async def update_model_record(
"description": "The model image was fetched successfully",
},
400: {"description": "Bad request"},
404: {"description": "The model could not be found"},
404: {"description": "The model image could not be found"}
},
status_code=200,
)
async def get_model_image(
key: str = Path(description="The name of model image file to get"),
) -> FileResponse:
"""Gets a full-resolution image file"""
"""Gets an image file that previews the model"""
try:
path = ApiDependencies.invoker.services.model_images.get_path(key)
if not path:
raise HTTPException(status_code=404)
response = FileResponse(
path,
media_type="image/png",