diff --git a/extensions/gallery/script.py b/extensions/gallery/script.py index 8d606352..87216a15 100644 --- a/extensions/gallery/script.py +++ b/extensions/gallery/script.py @@ -4,6 +4,8 @@ from pathlib import Path import gradio as gr +from modules.html_generator import image_to_base64 + def generate_html(): css = """ @@ -29,10 +31,14 @@ def generate_html(): background-color: gray; } - .character-gallery td { - text-align: center; - vertical-align: middle; + .character-gallery .image-td { + width: 150px; } + + .character-gallery .character-td { + text-align: center !important; + } + """ table_html = f'" diff --git a/modules/html_generator.py b/modules/html_generator.py index 6e1fb8ac..dc2aa387 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -200,7 +200,7 @@ def image_to_base64(path): if (path in image_cache and mtime != image_cache[path][0]) or (path not in image_cache): img = Image.open(path) - img.thumbnail((100, 100)) + img.thumbnail((200, 200)) img_buffer = BytesIO() img.convert('RGB').save(img_buffer, format='PNG') image_cache[path] = [mtime, base64.b64encode(img_buffer.getvalue()).decode("utf-8")]