From b6763fb8847df5a5678f37137e7a702569e5c925 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Mon, 5 Sep 2022 23:08:06 +0300 Subject: added random artist button added a setting for padding when doing inpaint at original resolution --- modules/shared.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/shared.py') diff --git a/modules/shared.py b/modules/shared.py index 70946fea..4e36df37 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -4,6 +4,7 @@ import os import gradio as gr import torch +import modules.artists from modules.paths import script_path, sd_path config_filename = "config.json" @@ -47,6 +48,8 @@ class State: state = State() +artist_db = modules.artists.ArtistsDatabase(os.path.join(script_path, 'artists.csv')) + class Options: class OptionInfo: @@ -84,6 +87,8 @@ class Options: "save_txt": OptionInfo(False, "Create a text file next to every image with generation parameters."), "ESRGAN_tile": OptionInfo(192, "Tile size for ESRGAN upscaling. 0 = no tiling.", gr.Slider, {"minimum": 0, "maximum": 512, "step": 16}), "ESRGAN_tile_overlap": OptionInfo(8, "Tile overlap, in pixels for ESRGAN upscaling. Low values = visible seam.", gr.Slider, {"minimum": 0, "maximum": 48, "step": 1}), + "random_artist_categories": OptionInfo([], "Allowed categories for random artists selection when using the Roll button", gr.CheckboxGroup, {"choices": artist_db.categories()}), + "upscale_at_full_resolution_padding": OptionInfo(16, "Inpainting at full resolution: padding, in pixels, for the masked region.", gr.Slider, {"minimum": 0, "maximum": 128, "step": 4}), } def __init__(self): @@ -122,3 +127,5 @@ if os.path.exists(config_filename): sd_upscalers = [] sd_model = None + + -- cgit v1.2.3