update pre-commit and fix ops

This commit is contained in:
Vladimir Mandic
2023-09-17 15:06:21 -04:00
parent f4492f4c86
commit d1302c09e3
9 changed files with 13 additions and 14 deletions
+3 -2
View File
@@ -462,7 +462,8 @@ def create_infotext(p: StableDiffusionProcessing, all_prompts, all_seeds, all_su
if all_negative_prompts is None:
all_negative_prompts = p.all_negative_prompts
comment = ', '.join(comments) if comments is not None and type(comments) is list else None
ops = list(set(p.ops))
ops.reverse()
args = {
# basic
"Steps": p.steps,
@@ -488,7 +489,7 @@ def create_infotext(p: StableDiffusionProcessing, all_prompts, all_seeds, all_su
"Backend": 'Diffusers' if shared.backend == shared.Backend.DIFFUSERS else 'Original',
"Version": git_commit,
"Comment": comment,
"Operations": '; '.join(p.ops).replace('"', '') if len(p.ops) > 0 else 'none',
"Operations": '; '.join(ops).replace('"', '') if len(p.ops) > 0 else 'none',
}
if 'txt2img' in p.ops:
pass
+2 -2
View File
@@ -71,7 +71,7 @@ class Script:
"""For AlwaysVisible scripts, this function is called when the processing object is set up, before any processing starts.
args contains all values returned by components from ui().
"""
pass
pass # pylint: disable=unnecessary-pass
def before_process(self, p, *args):
"""
@@ -79,7 +79,7 @@ class Script:
You can modify the processing object (p) here, inject hooks, etc.
args contains all values returned by components from ui()
"""
pass
pass # pylint: disable=unnecessary-pass
def process(self, p, *args):
"""
+1 -3
View File
@@ -486,14 +486,13 @@ options_templates.update(options_section(('saving-images', "Image Options"), {
"n_rows": OptionInfo(-1, "Grid row count", gr.Slider, {"minimum": -1, "maximum": 16, "step": 1}),
"save_sep_options": OptionInfo("<h2>Intermediate Image Saving</h2>", "", gr.HTML),
"save_init_img": OptionInfo(True, "Save copy of img2img init images"),
"save_init_img": OptionInfo(False, "Save copy of img2img init images"),
"save_images_before_highres_fix": OptionInfo(False, "Save copy of image before applying highres fix"),
"save_images_before_refiner": OptionInfo(False, "Save copy of image before running refiner"),
"save_images_before_face_restoration": OptionInfo(False, "Save copy of image before doing face restoration"),
"save_images_before_color_correction": OptionInfo(False, "Save copy of image before applying color correction"),
"save_mask": OptionInfo(False, "Save copy of the inpainting greyscale mask"),
"save_mask_composite": OptionInfo(False, "Save copy of inpainting masked composite"),
}))
options_templates.update(options_section(('saving-paths', "Image Naming & Paths"), {
@@ -521,7 +520,6 @@ options_templates.update(options_section(('saving-paths', "Image Naming & Paths"
"outdir_grids": OptionInfo("", "Output directory for grids", component_args=hide_dirs, folder=True),
"outdir_txt2img_grids": OptionInfo("outputs/grids", 'Output directory for txt2img grids', component_args=hide_dirs, folder=True),
"outdir_img2img_grids": OptionInfo("outputs/grids", 'Output directory for img2img grids', component_args=hide_dirs, folder=True),
}))
options_templates.update(options_section(('ui', "User Interface"), {
@@ -39,7 +39,7 @@ class ExtraNetworksPageTextualInversion(ui_extra_networks.ExtraNetworksPage):
embeddings = list(sd_models.model_data.sd_model.embedding_db.word_embeddings.values())
else:
embeddings = []
embeddings = list(sorted(embeddings, key=lambda emb: emb.filename))
embeddings = sorted(embeddings, key=lambda emb: emb.filename)
for embedding in embeddings:
path, _ext = os.path.splitext(embedding.filename)
tags = {}