minor updates

This commit is contained in:
Vladimir Mandic
2023-05-21 18:49:05 -04:00
parent 26b05ef883
commit d647bb5c05
6 changed files with 10 additions and 9 deletions
+1
View File
@@ -108,6 +108,7 @@ def compatibility_args(opts, args):
opts.print_hypernet_extra = False
opts.dimensions_and_batch_together = True
opts.enable_pnginfo = True
opts.data['clip_skip'] = 1
args = parser.parse_args()
return args
+2 -2
View File
@@ -513,7 +513,6 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='jpg', i
txt_fullfn (`str` or None):
If a text file is saved for this image, this will be its full path. Otherwise None.
"""
namegen = FilenameGenerator(p, seed, prompt, image)
if image is None:
shared.log.warning('Image is none')
return None, None
@@ -521,9 +520,10 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='jpg', i
return None, None
if path is None: # set default path to avoid errors when functions are triggered manually or via api and param is not set
path = shared.opts.outdir_save
namegen = FilenameGenerator(p, seed, prompt, image)
if save_to_dirs is None:
save_to_dirs = (grid and shared.opts.grid_save_to_dirs) or (not grid and shared.opts.save_to_dirs and not no_prompt)
if save_to_dirs:
else:
dirname = namegen.apply(shared.opts.directories_filename_pattern or "[prompt_words]").lstrip(' ').rstrip('\\ /')
path = os.path.join(path, dirname)
os.makedirs(path, exist_ok=True)
+1 -1
View File
@@ -161,7 +161,7 @@ def get_learned_conditioning(model, prompts, steps):
prompt_schedules = get_learned_conditioning_prompt_schedules(prompts, steps)
cache = {}
for prompt, prompt_schedule in zip(prompts, prompt_schedules):
log.debug(f'Prompt schedule: {prompt_schedule}')
# log.debug(f'Prompt schedule: {prompt_schedule}')
cached = cache.get(prompt, None)
if cached is not None:
res.append(cached)
+4 -4
View File
@@ -111,20 +111,20 @@ def initialize():
startup_timer.record("upscalers")
shared.opts.onchange("sd_vae", wrap_queued_call(lambda: modules.sd_vae.reload_vae_weights()), call=False)
# shared.opts.onchange("sd_vae_as_default", wrap_queued_call(lambda: modules.sd_vae.reload_vae_weights()), call=False)
shared.opts.onchange("temp_dir", ui_tempdir.on_tmpdir_changed)
shared.opts.onchange("gradio_theme", shared.reload_gradio_theme)
startup_timer.record("opts onchange")
startup_timer.record("onchange")
modules.textual_inversion.textual_inversion.list_textual_inversion_templates()
shared.reload_hypernetworks()
ui_extra_networks.intialize()
ui_extra_networks.register_page(ui_extra_networks_hypernets.ExtraNetworksPageHypernetworks())
ui_extra_networks.register_page(ui_extra_networks_checkpoints.ExtraNetworksPageCheckpoints())
ui_extra_networks.register_page(ui_extra_networks_textual_inversion.ExtraNetworksPageTextualInversion())
extra_networks.initialize()
extra_networks.register_extra_network(extra_networks_hypernet.ExtraNetworkHypernet())
startup_timer.record("extra networks")
startup_timer.record("extra-networks")
if cmd_opts.tls_keyfile is not None and cmd_opts.tls_keyfile is not None:
try:
@@ -137,7 +137,7 @@ def initialize():
log.error("TLS setup invalid, running webui without TLS")
else:
log.info("Running with TLS")
startup_timer.record("TLS")
startup_timer.record("tls")
# make the program just exit at ctrl+c without waiting for anything
def sigint_handler(_sig, _frame):