mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
re-layout of main settings
This commit is contained in:
+5
-4
@@ -1,11 +1,11 @@
|
||||
# Change Log for SD.Next
|
||||
|
||||
## Update for 2023-09-12
|
||||
## Update for 2023-09-13
|
||||
|
||||
Mostly a service release, but with some changes in behavior, especially in HiRes area of the code...
|
||||
|
||||
- tons of fixes
|
||||
- changes to **hires**
|
||||
- changes to **hires**
|
||||
- enable non-latent upscale modes (standard upscalers)
|
||||
- when using latent upscale, hires pass is run automatically
|
||||
- when using non-latent upscalers, hires pass is skipped by default
|
||||
@@ -18,8 +18,9 @@ Mostly a service release, but with some changes in behavior, especially in HiRes
|
||||
- all combinations of: decode full/quick + upscale none/latent/non-latent + hires on/off + refiner on/off
|
||||
should be supported, but given the number of combinations, issues are possible
|
||||
- all operations are captured in image medata
|
||||
- update **ui hints**
|
||||
- updated **models -> civitai**
|
||||
- minor re-layout of the main ui
|
||||
- update **ui hints**
|
||||
- updated **models -> civitai**
|
||||
- search and download loras
|
||||
- find previews for already downloaded models or loras
|
||||
- new option **inference mode**
|
||||
|
||||
@@ -25,6 +25,7 @@ div.gradio-html.min{ min-height: 0; }
|
||||
.gradio-dropdown.multiselect div.wrap-inner { overflow-x: hidden; overflow-y: auto; max-height: 50vh; overflow-wrap: anywhere; }
|
||||
.gradio-html div.wrap{ height: 100%; }
|
||||
.gradio-slider input[type="number"]{ width: 6em; margin-left: 0.5em; }
|
||||
.gradio-accordion { padding-top: var(--spacing-md) !important; padding-right: 0 !important; padding-bottom: 0 !important; color: var(--body-text-color); }
|
||||
.hidden { display: none; }
|
||||
footer { display: none; }
|
||||
td { border-bottom: none !important; }
|
||||
@@ -265,7 +266,11 @@ div.controlnet_main_options { display: grid; grid-template-columns: 1fr 1fr; gri
|
||||
|
||||
/* specific elements */
|
||||
#modelmerger_interp_description { margin-top: 1em; margin-bottom: 1em; }
|
||||
#scripts_alwayson_txt2img, #scripts_alwayson_img2img { display: grid }
|
||||
#scripts_alwayson_txt2img, #scripts_alwayson_img2img { display: grid; padding: 0 }
|
||||
#scripts_alwayson_txt2img > .label-wrap, #scripts_alwayson_img2img > .label-wrap { background: var(--input-background-fill); padding: 0; margin: 0; border-radius: var(--radius-lg); }
|
||||
#scripts_alwayson_txt2img > .label-wrap > span, #scripts_alwayson_img2img > .label-wrap > span { padding: var(--spacing-xxl); }
|
||||
#script_txt2img_agent_scheduler { display: none; }
|
||||
|
||||
#extras_generate, #extras_interrupt, #extras_skip { display: block !important; position: relative; height: 36px; }
|
||||
#extras_upscale { margin-top: 10px }
|
||||
#refresh_tac_refreshTempFiles { display: none; }
|
||||
|
||||
+15
-15
@@ -343,7 +343,7 @@ class ScriptRunner:
|
||||
def setup_ui(self):
|
||||
import modules.api.models as api_models
|
||||
self.titles = [wrap_call(script.title, script.filename, "title") or f"{script.filename} [error]" for script in self.selectable_scripts]
|
||||
inputs = [None]
|
||||
inputs = []
|
||||
inputs_alwayson = [True]
|
||||
|
||||
def create_script_ui(script, inputs, inputs_alwayson):
|
||||
@@ -377,38 +377,28 @@ class ScriptRunner:
|
||||
inputs_alwayson += [script.alwayson for _ in controls]
|
||||
script.args_to = len(inputs)
|
||||
|
||||
with gr.Group(elem_id='scripts_alwayson_img2img' if self.is_img2img else 'scripts_alwayson_txt2img'):
|
||||
for script in self.alwayson_scripts:
|
||||
t0 = time.time()
|
||||
elem_id = f'script_{"txt2img" if script.is_txt2img else "img2img"}_{script.title().lower().replace(" ", "_")}'
|
||||
with gr.Group(elem_id=elem_id) as group:
|
||||
create_script_ui(script, inputs, inputs_alwayson)
|
||||
script.group = group
|
||||
time_setup[script.title()] = time_setup.get(script.title(), 0) + (time.time()-t0)
|
||||
|
||||
dropdown = gr.Dropdown(label="Script", elem_id="script_list", choices=["None"] + self.titles, value="None", type="index")
|
||||
inputs[0] = dropdown
|
||||
inputs.insert(0, dropdown)
|
||||
for script in self.selectable_scripts:
|
||||
with gr.Group(visible=False) as group:
|
||||
t0 = time.time()
|
||||
create_script_ui(script, inputs, inputs_alwayson)
|
||||
time_setup[script.title()] = time_setup.get(script.title(), 0) + (time.time()-t0)
|
||||
script.group = group
|
||||
script.group = group
|
||||
|
||||
def select_script(script_index):
|
||||
selected_script = self.selectable_scripts[script_index - 1] if script_index > 0 else None
|
||||
return [gr.update(visible=selected_script == s) for s in self.selectable_scripts]
|
||||
|
||||
def init_field(title):
|
||||
"""called when an initial value is set from ui-config.json to show script's UI components"""
|
||||
if title == 'None':
|
||||
if title == 'None': # called when an initial value is set from ui-config.json to show script's UI components
|
||||
return
|
||||
script_index = self.titles.index(title)
|
||||
self.selectable_scripts[script_index].group.visible = True
|
||||
|
||||
dropdown.init_field = init_field
|
||||
dropdown.change(fn=select_script, inputs=[dropdown], outputs=[script.group for script in self.selectable_scripts])
|
||||
|
||||
|
||||
def onload_script_visibility(params):
|
||||
title = params.get('Script', None)
|
||||
if title:
|
||||
@@ -419,6 +409,16 @@ class ScriptRunner:
|
||||
else:
|
||||
return gr.update(visible=False)
|
||||
|
||||
# with gr.Group(elem_id='scripts_alwayson_img2img' if self.is_img2img else 'scripts_alwayson_txt2img'):
|
||||
with gr.Accordion(label="Extensions", elem_id='scripts_alwayson_img2img' if self.is_img2img else 'scripts_alwayson_txt2img'):
|
||||
for script in self.alwayson_scripts:
|
||||
t0 = time.time()
|
||||
elem_id = f'script_{"txt2img" if script.is_txt2img else "img2img"}_{script.title().lower().replace(" ", "_")}'
|
||||
with gr.Group(elem_id=elem_id) as group:
|
||||
create_script_ui(script, inputs, inputs_alwayson)
|
||||
script.group = group
|
||||
time_setup[script.title()] = time_setup.get(script.title(), 0) + (time.time()-t0)
|
||||
|
||||
self.infotext_fields.append( (dropdown, lambda x: gr.update(value=x.get('Script', 'None'))) )
|
||||
self.infotext_fields.extend( [(script.group, onload_script_visibility) for script in self.selectable_scripts] )
|
||||
return inputs
|
||||
|
||||
+1
-2
@@ -417,8 +417,7 @@ def create_ui(startup_timer = None):
|
||||
with FormRow(elem_id="txt2img_override_settings_row") as row:
|
||||
override_settings = create_override_settings_dropdown('txt2img', row)
|
||||
|
||||
with FormGroup(elem_id="txt2img_script_container"):
|
||||
custom_inputs = modules.scripts.scripts_txt2img.setup_ui()
|
||||
custom_inputs = modules.scripts.scripts_txt2img.setup_ui()
|
||||
|
||||
hr_resolution_preview_inputs = [show_second_pass, width, height, hr_scale, hr_resize_x, hr_resize_y, hr_upscaler]
|
||||
for preview_input in hr_resolution_preview_inputs:
|
||||
|
||||
@@ -39,7 +39,7 @@ def draw_xy_grid(xs, ys, x_label, y_label, cell):
|
||||
|
||||
class Script(scripts.Script):
|
||||
def title(self):
|
||||
return "Prompt matrix"
|
||||
return "Prompt Matrix"
|
||||
|
||||
def ui(self, is_img2img):
|
||||
gr.HTML('<br />')
|
||||
|
||||
@@ -101,7 +101,7 @@ def load_prompt_file(file):
|
||||
|
||||
class Script(scripts.Script):
|
||||
def title(self):
|
||||
return "Prompts from file"
|
||||
return "Prompts from File"
|
||||
|
||||
def ui(self, is_img2img):
|
||||
checkbox_iterate = gr.Checkbox(label="Iterate seed every line", value=False, elem_id=self.elem_id("checkbox_iterate"))
|
||||
|
||||
+1
-1
@@ -375,7 +375,7 @@ re_range_count_float = re.compile(r"\s*([+-]?\s*\d+(?:.\d*)?)\s*-\s*([+-]?\s*\d+
|
||||
|
||||
class Script(scripts.Script):
|
||||
def title(self):
|
||||
return "X/Y/Z grid"
|
||||
return "X/Y/Z Grid"
|
||||
|
||||
def ui(self, is_img2img):
|
||||
self.current_axis_options = [x for x in axis_options if type(x) == AxisOption or x.is_img2img == is_img2img]
|
||||
|
||||
Reference in New Issue
Block a user