Upload 3 files
Browse files- modutils.py +2 -5
modutils.py
CHANGED
@@ -300,9 +300,6 @@ def save_images(images: list[Image.Image], metadatas: list[str]):
|
|
300 |
|
301 |
def save_gallery_images(images, model_name="", progress=gr.Progress(track_tqdm=True)):
|
302 |
progress(0, desc="Updating gallery...")
|
303 |
-
#dt_now = datetime.now(timezone(timedelta(hours=9)))
|
304 |
-
#dt_now = datetime.now(FILENAME_TIMEZONE)
|
305 |
-
#basename = dt_now.strftime('%Y%m%d_%H%M%S_')
|
306 |
basename = f"{model_name.split('/')[-1]}_{datetime.now(FILENAME_TIMEZONE).strftime('%Y%m%d_%H%M%S')}_"
|
307 |
if not images: return images, gr.update()
|
308 |
output_images = []
|
@@ -332,9 +329,9 @@ def save_gallery_history(images, files, history_gallery, history_files, progress
|
|
332 |
return gr.update(value=output_gallery), gr.update(value=output_files, visible=True)
|
333 |
|
334 |
|
335 |
-
def save_image_history(image
|
336 |
basename = f"{model_name.split('/')[-1]}_{datetime.now(FILENAME_TIMEZONE).strftime('%Y%m%d_%H%M%S')}"
|
337 |
-
if not image: return gr.update(), gr.update()
|
338 |
if not gallery: gallery = []
|
339 |
if not files: files = []
|
340 |
filename = f"{basename}.png"
|
|
|
300 |
|
301 |
def save_gallery_images(images, model_name="", progress=gr.Progress(track_tqdm=True)):
|
302 |
progress(0, desc="Updating gallery...")
|
|
|
|
|
|
|
303 |
basename = f"{model_name.split('/')[-1]}_{datetime.now(FILENAME_TIMEZONE).strftime('%Y%m%d_%H%M%S')}_"
|
304 |
if not images: return images, gr.update()
|
305 |
output_images = []
|
|
|
329 |
return gr.update(value=output_gallery), gr.update(value=output_files, visible=True)
|
330 |
|
331 |
|
332 |
+
def save_image_history(image, gallery, files, model_name: str, progress=gr.Progress(track_tqdm=True)):
|
333 |
basename = f"{model_name.split('/')[-1]}_{datetime.now(FILENAME_TIMEZONE).strftime('%Y%m%d_%H%M%S')}"
|
334 |
+
if image is None or not isinstance(image, tuple): return gr.update(), gr.update()
|
335 |
if not gallery: gallery = []
|
336 |
if not files: files = []
|
337 |
filename = f"{basename}.png"
|