diff --git a/CHANGELOG.md b/CHANGELOG.md index 42b738dd5..23e8e7a45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log for SD.Next +## Update for 2023-12-30 + +- Fixes: + - img2img interrogate + ## Update for 2023-12-29 - **Control** diff --git a/extensions-builtin/sd-webui-controlnet b/extensions-builtin/sd-webui-controlnet index dc0d590fa..50ddf1da9 160000 --- a/extensions-builtin/sd-webui-controlnet +++ b/extensions-builtin/sd-webui-controlnet @@ -1 +1 @@ -Subproject commit dc0d590faf3240746212477a95c3026aa7e9584f +Subproject commit 50ddf1da960ad4ca7800d65cdde4553e746bcbf7 diff --git a/javascript/sdnext.css b/javascript/sdnext.css index 8ebaf10c5..e9fe1d468 100644 --- a/javascript/sdnext.css +++ b/javascript/sdnext.css @@ -87,7 +87,7 @@ button.custom-button{ border-radius: var(--button-large-radius); padding: var(-- #txt2img_actions_column, #img2img_actions_column, #control_actions { flex-flow: wrap; justify-content: space-between; } #txt2img_enqueue_wrapper, #img2img_enqueue_wrapper, #control_enqueue_wrapper { min-width: unset !important; width: 48%; } .interrogate-col{ min-width: 0 !important; max-width: fit-content; margin-right: var(--spacing-xxl); } -.interrogate-col>button{ flex: 1; } +.interrogate-col>button{ flex: 1; width: 7em; max-height: 84px; } #sampler_selection_img2img { margin-top: 1em; } #txtimg_hr_finalres{ min-height: 0 !important; } #img2img_scale_resolution_preview.block{ display: flex; align-items: end; } diff --git a/modules/interrogate.py b/modules/interrogate.py index 5e7d249de..1a60f728c 100644 --- a/modules/interrogate.py +++ b/modules/interrogate.py @@ -80,12 +80,13 @@ class InterrogateModels: self.create_fake_fairscale() import models.blip # pylint: disable=no-name-in-module model_path = os.path.join(paths.models_path, "BLIP") - shared.log.debug(f'Loading interrogate model: type=BLIP folder={model_path}') + download_name='model_base_caption_capfilt_large.pth', + shared.log.debug(f'Model interrogate load: type=BLiP model={download_name} path={model_path}') files = modelloader.load_models( model_path=model_path, model_url='https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_base_caption_capfilt_large.pth', ext_filter=[".pth"], - download_name='model_base_caption_capfilt_large.pth', + download_name=download_name, ) blip_model = models.blip.blip_decoder(pretrained=files[0], image_size=blip_image_eval_size, vit='base', med_config=os.path.join(paths.paths["BLIP"], "configs", "med_config.json")) # pylint: disable=c-extension-no-member blip_model.eval() @@ -93,6 +94,7 @@ class InterrogateModels: return blip_model def load_clip_model(self): + shared.log.debug(f'Model interrogate load: type=CLiP model={clip_model_name} path={shared.opts.clip_models_path}') import clip if self.running_on_cpu: model, preprocess = clip.load(clip_model_name, device="cpu", download_root=shared.opts.clip_models_path) diff --git a/modules/processing_diffusers.py b/modules/processing_diffusers.py index 66877a83a..54cab61bc 100644 --- a/modules/processing_diffusers.py +++ b/modules/processing_diffusers.py @@ -217,14 +217,14 @@ def process_diffusers(p: StableDiffusionProcessing): if 'prompt' in possible: if hasattr(model, 'text_encoder') and 'prompt_embeds' in possible and len(p.prompt_embeds) > 0 and p.prompt_embeds[0] is not None: args['prompt_embeds'] = p.prompt_embeds[0] - if 'XL' in model.__class__.__name__: - args['pooled_prompt_embeds'] = p.positive_pooleds[0] + if 'XL' in model.__class__.__name__ and len(getattr(p, 'negative_pooleds', [])) > 0: + args['pooled_prompt_embeds'] = p.negative_pooleds[0] else: args['prompt'] = prompts if 'negative_prompt' in possible: if hasattr(model, 'text_encoder') and 'negative_prompt_embeds' in possible and len(p.negative_embeds) > 0 and p.negative_embeds[0] is not None: args['negative_prompt_embeds'] = p.negative_embeds[0] - if 'XL' in model.__class__.__name__: + if 'XL' in model.__class__.__name__ and len(getattr(p, 'negative_pooleds', [])) > 0: args['negative_pooled_prompt_embeds'] = p.negative_pooleds[0] else: args['negative_prompt'] = negative_prompts diff --git a/modules/ui.py b/modules/ui.py index 6bba53a3e..a1c76ff1f 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -111,6 +111,7 @@ def parse_style(styles): def process_interrogate(interrogation_function, mode, ii_input_files, ii_input_dir, ii_output_dir, *ii_singles): + mode = int(mode) if mode in {0, 1, 3, 4}: return [interrogation_function(ii_singles[mode]), None] if mode == 2: diff --git a/wiki b/wiki index 9a9713ecb..6ba553609 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 9a9713ecbbebaeebe9b15f895d6cab566d3a79a7 +Subproject commit 6ba5536099537d54d5767447f27e0c5ec0d89705