Store thumbnails as files instead of base64 strings

This improves the UI responsiveness for large histories.
This commit is contained in:
oobabooga 2023-02-27 13:41:00 -03:00
parent a08802bf70
commit 43b6ab8673
3 changed files with 15 additions and 14 deletions

View file

@ -2,7 +2,7 @@ from pathlib import Path
import gradio as gr
from modules.html_generator import image_to_base64
from modules.html_generator import get_image_cache
def generate_html():
@ -64,7 +64,7 @@ def generate_html():
path = Path(i)
if path.exists():
try:
image_html = f'<img src="data:image/png;base64,{image_to_base64(path)}">'
image_html = f'<img src="file/{get_image_cache(path)}">'
break
except:
continue