mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(mm): model images reload when changed
When we change a model image, its URL remains the same. The browser will aggressively cache the image. The easiest way to fix this is to append a random query parameter to the URL whenever we build a model config in the API.
This commit is contained in:
parent
8959d1bf51
commit
a3a42d25d3
@ -5,6 +5,7 @@ from PIL.Image import Image as PILImageType
|
|||||||
from send2trash import send2trash
|
from send2trash import send2trash
|
||||||
|
|
||||||
from invokeai.app.services.invoker import Invoker
|
from invokeai.app.services.invoker import Invoker
|
||||||
|
from invokeai.app.util.misc import uuid_string
|
||||||
from invokeai.app.util.thumbnails import make_thumbnail
|
from invokeai.app.util.thumbnails import make_thumbnail
|
||||||
|
|
||||||
from .model_images_base import ModelImageFileStorageBase
|
from .model_images_base import ModelImageFileStorageBase
|
||||||
@ -56,7 +57,12 @@ class ModelImageFileStorageDisk(ModelImageFileStorageBase):
|
|||||||
if not self._validate_path(path):
|
if not self._validate_path(path):
|
||||||
return
|
return
|
||||||
|
|
||||||
return self._invoker.services.urls.get_model_image_url(model_key)
|
url = self._invoker.services.urls.get_model_image_url(model_key)
|
||||||
|
|
||||||
|
# The image file
|
||||||
|
url += f"?{uuid_string()}"
|
||||||
|
|
||||||
|
return url
|
||||||
|
|
||||||
def delete(self, model_key: str) -> None:
|
def delete(self, model_key: str) -> None:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user