Commit 26fd4448 authored by AUTOMATIC's avatar AUTOMATIC

bump gradio to 3.16.2

change style selection to multiselect dropdown
parents d8f8bcb8 865228a8
......@@ -10,10 +10,8 @@ ignore_ids_for_localization={
modelmerger_tertiary_model_name: 'OPTION',
train_embedding: 'OPTION',
train_hypernetwork: 'OPTION',
txt2img_style_index: 'OPTION',
txt2img_style2_index: 'OPTION',
img2img_style_index: 'OPTION',
img2img_style2_index: 'OPTION',
txt2img_styles: 'OPTION',
img2img_styles 'OPTION',
setting_random_artist_categories: 'SPAN',
setting_face_restoration_model: 'SPAN',
setting_realesrgan_enabled_models: 'SPAN',
......
......@@ -59,7 +59,7 @@ def process_batch(p, input_dir, output_dir, args):
processed_image.save(os.path.join(output_dir, filename))
def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_style: str, prompt_style2: str, init_img, sketch, init_img_with_mask, inpaint_color_sketch, inpaint_color_sketch_orig, init_img_inpaint, init_mask_inpaint, steps: int, sampler_index: int, mask_blur: int, mask_alpha: float, inpainting_fill: int, restore_faces: bool, tiling: bool, n_iter: int, batch_size: int, cfg_scale: float, denoising_strength: float, seed: int, subseed: int, subseed_strength: float, seed_resize_from_h: int, seed_resize_from_w: int, seed_enable_extras: bool, height: int, width: int, resize_mode: int, inpaint_full_res: bool, inpaint_full_res_padding: int, inpainting_mask_invert: int, img2img_batch_input_dir: str, img2img_batch_output_dir: str, *args):
def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_styles, init_img, sketch, init_img_with_mask, inpaint_color_sketch, inpaint_color_sketch_orig, init_img_inpaint, init_mask_inpaint, steps: int, sampler_index: int, mask_blur: int, mask_alpha: float, inpainting_fill: int, restore_faces: bool, tiling: bool, n_iter: int, batch_size: int, cfg_scale: float, denoising_strength: float, seed: int, subseed: int, subseed_strength: float, seed_resize_from_h: int, seed_resize_from_w: int, seed_enable_extras: bool, height: int, width: int, resize_mode: int, inpaint_full_res: bool, inpaint_full_res_padding: int, inpainting_mask_invert: int, img2img_batch_input_dir: str, img2img_batch_output_dir: str, *args):
is_batch = mode == 5
if mode == 0: # img2img
......@@ -101,7 +101,7 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
outpath_grids=opts.outdir_grids or opts.outdir_img2img_grids,
prompt=prompt,
negative_prompt=negative_prompt,
styles=[prompt_style, prompt_style2],
styles=prompt_styles,
seed=seed,
subseed=subseed,
subseed_strength=subseed_strength,
......
......@@ -40,12 +40,18 @@ def apply_styles_to_prompt(prompt, styles):
class StyleDatabase:
def __init__(self, path: str):
self.no_style = PromptStyle("None", "", "")
self.styles = {"None": self.no_style}
self.styles = {}
self.path = path
if not os.path.exists(path):
self.reload()
def reload(self):
self.styles.clear()
if not os.path.exists(self.path):
return
with open(path, "r", encoding="utf-8-sig", newline='') as file:
with open(self.path, "r", encoding="utf-8-sig", newline='') as file:
reader = csv.DictReader(file)
for row in reader:
# Support loading old CSV format with "name, text"-columns
......
......@@ -8,13 +8,13 @@ import modules.processing as processing
from modules.ui import plaintext_to_html
def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_style: str, prompt_style2: str, steps: int, sampler_index: int, restore_faces: bool, tiling: bool, n_iter: int, batch_size: int, cfg_scale: float, seed: int, subseed: int, subseed_strength: float, seed_resize_from_h: int, seed_resize_from_w: int, seed_enable_extras: bool, height: int, width: int, enable_hr: bool, denoising_strength: float, hr_scale: float, hr_upscaler: str, hr_second_pass_steps: int, hr_resize_x: int, hr_resize_y: int, *args):
def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, steps: int, sampler_index: int, restore_faces: bool, tiling: bool, n_iter: int, batch_size: int, cfg_scale: float, seed: int, subseed: int, subseed_strength: float, seed_resize_from_h: int, seed_resize_from_w: int, seed_enable_extras: bool, height: int, width: int, enable_hr: bool, denoising_strength: float, hr_scale: float, hr_upscaler: str, hr_second_pass_steps: int, hr_resize_x: int, hr_resize_y: int, *args):
p = StableDiffusionProcessingTxt2Img(
sd_model=shared.sd_model,
outpath_samples=opts.outdir_samples or opts.outdir_txt2img_samples,
outpath_grids=opts.outdir_grids or opts.outdir_txt2img_grids,
prompt=prompt,
styles=[prompt_style, prompt_style2],
styles=prompt_styles,
negative_prompt=negative_prompt,
seed=seed,
subseed=subseed,
......
This diff is collapsed.
......@@ -3,7 +3,7 @@ transformers==4.19.2
accelerate==0.12.0
basicsr==1.4.2
gfpgan==1.3.8
gradio==3.15.0
gradio==3.16.2
numpy==1.23.3
Pillow==9.4.0
realesrgan==0.3.0
......
......@@ -20,7 +20,7 @@
padding-right: 0.25em;
margin: 0.1em 0;
opacity: 0%;
cursor: default;
cursor: default;
}
.output-html p {margin: 0 0.5em;}
......@@ -114,6 +114,7 @@
min-width: unset !important;
flex-grow: 0 !important;
padding: 0.4em 0;
gap: 0;
}
#roll_col > button {
......@@ -141,10 +142,14 @@
min-width: 8em !important;
}
#txt2img_style_index, #txt2img_style2_index, #img2img_style_index, #img2img_style2_index{
#txt2img_styles, #img2img_styles{
margin-top: 1em;
}
#txt2img_styles ul, #img2img_styles ul{
max-height: 35em;
}
.gr-form{
background: transparent;
}
......@@ -154,10 +159,14 @@
margin-bottom: 0;
}
#toprow div{
#toprow div.gr-box, #toprow div.gr-form{
border: none;
gap: 0;
background: transparent;
box-shadow: none;
}
#toprow div{
gap: 0;
}
#resize_mode{
......@@ -221,7 +230,10 @@ fieldset span.text-gray-500, .gr-block.gr-box span.text-gray-500, label.block s
.dark fieldset span.text-gray-500, .dark .gr-block.gr-box span.text-gray-500, .dark label.block span{
background-color: rgb(31, 41, 55);
box-shadow: 6px 0 6px 0px rgb(31, 41, 55), -6px 0 6px 0px rgb(31, 41, 55);
box-shadow: none;
border: 1px solid rgba(128, 128, 128, 0.1);
border-radius: 6px;
padding: 0.1em 0.5em;
}
#txt2img_column_batch, #img2img_column_batch{
......@@ -379,7 +391,7 @@ input[type="range"]{
grid-area: tile;
}
.modalClose,
.modalClose,
.modalZoom,
.modalTileImage {
color: white;
......@@ -519,29 +531,20 @@ input[type="range"]{
}
#quicksettings > div{
border: none;
background: none;
flex: unset;
gap: 1em;
}
#quicksettings > div > div{
max-width: 32em;
max-width: 24em;
min-width: 24em;
padding: 0;
border: none;
box-shadow: none;
background: none;
}
#quicksettings > div > div > div > div > label > span {
#quicksettings > div > div > div > label > span {
position: relative;
margin-right: 9em;
margin-bottom: -1em;
}
#quicksettings > div > div > label > span {
position: relative;
margin-bottom: -1em;
}
canvas[key="mask"] {
z-index: 12 !important;
filter: invert();
......@@ -631,7 +634,11 @@ canvas[key="mask"] {
max-width: 2.5em;
min-width: 2.5em !important;
height: 2.4em;
margin: 0.55em 0.7em 0.55em 0;
margin: 1.6em 0.7em 0.55em 0;
}
#tab_modelmerger .gr-button-tool{
margin: 0.6em 0em 0.55em 0;
}
#quicksettings .gr-button-tool{
......@@ -676,7 +683,10 @@ footer {
font-weight: bold;
}
#txt2img_checkboxes > div > div{
#txt2img_checkboxes, #img2img_checkboxes{
margin-bottom: 0.5em;
}
#txt2img_checkboxes > div > div, #img2img_checkboxes > div > div{
flex: 0;
white-space: nowrap;
min-width: auto;
......@@ -686,6 +696,29 @@ footer {
opacity: 0.5;
}
.gr-compact {
border: none;
}
.dark .gr-compact{
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
margin-left: 0.8em;
}
.gr-compact > *{
margin-top: 0.5em !important;
}
.gr-compact .gr-block, .gr-compact .gr-form{
border: none;
box-shadow: none;
}
.gr-compact .gr-box{
border-radius: .5rem !important;
border-width: 1px !important;
}
#mode_img2img > div > div{
gap: 0 !important;
}
......@@ -781,4 +814,4 @@ Then, you will need to add the RTL counterpart only if needed in the rtl section
right: unset;
left: 0.5em;
}
}
\ No newline at end of file
}
......@@ -158,7 +158,7 @@ def webui():
shared.demo = modules.ui.create_ui()
app, local_url, share_url = shared.demo.queue(default_enabled=False).launch(
app, local_url, share_url = shared.demo.launch(
share=cmd_opts.share,
server_name=server_name,
server_port=cmd_opts.port,
......@@ -188,7 +188,6 @@ def webui():
create_api(app)
modules.script_callbacks.app_started_callback(shared.demo, app)
modules.script_callbacks.app_started_callback(shared.demo, app)
wait_on_server(shared.demo)
print('Restarting UI...')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment