From f9940b79dc9f67477cec3819dbfb250f5e92a658 Mon Sep 17 00:00:00 2001 From: ye7iaserag Date: Fri, 31 Mar 2023 04:56:49 +0200 Subject: [PATCH] Implement character gallery using Dataset --- extensions/gallery/script.py | 38 +++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/extensions/gallery/script.py b/extensions/gallery/script.py index fbf23bc9..e96fe40a 100644 --- a/extensions/gallery/script.py +++ b/extensions/gallery/script.py @@ -1,20 +1,23 @@ from pathlib import Path - import gradio as gr - from modules.html_generator import get_image_cache +from modules.chat import load_character +from modules.shared import gradio, settings - -def generate_html(): +def generate_css(): css = """ - .character-gallery { + .character-gallery > .gallery { margin: 1rem 0; - display: grid; + display: grid !important; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); grid-column-gap: 0.4rem; grid-row-gap: 1.2rem; } + .character-gallery > .label { + display: none !important; + } + .character-container { cursor: pointer; text-align: center; @@ -45,14 +48,16 @@ def generate_html(): overflow-wrap: anywhere; } """ + return css - container_html = f'