diff --git a/extensions-builtin/sd-webui-controlnet b/extensions-builtin/sd-webui-controlnet index f77c5eb5f..56d575e8d 160000 --- a/extensions-builtin/sd-webui-controlnet +++ b/extensions-builtin/sd-webui-controlnet @@ -1 +1 @@ -Subproject commit f77c5eb5fa6dea0136d36a6fc9f9f00a99d8f2cb +Subproject commit 56d575e8dd529ecd7efa066f13781608fb6b1da9 diff --git a/javascript/black-teal.css b/javascript/black-teal.css index fe9309265..3552d325f 100644 --- a/javascript/black-teal.css +++ b/javascript/black-teal.css @@ -27,7 +27,7 @@ --button-secondary-text-color: white; --button-secondary-background-fill: linear-gradient(to bottom right, var(--neutral-400), var(--neutral-700)); --button-secondary-background-fill-hover: linear-gradient(to bottom right, var(--neutral-700), var(--neutral-400)); - --block-title-text-color: var(--neutral-900); + --block-title-text-color: var(--neutral-300); --radius-sm: 2px; --radius-lg: 4px; --spacing-md: 4px; @@ -134,7 +134,7 @@ svg.feather.feather-image, .feather .feather-image { display: none } --background-fill-secondary: none; --border-color-accent: var(--background-color); --border-color-primary: var(--background-color); - --link-text-color-active: var(--secondary-500); + --link-text-color-active: var(--primary-500); --link-text-color: var(--secondary-500); --link-text-color-hover: var(--secondary-400); --link-text-color-visited: var(--secondary-600); diff --git a/modules/prompt_parser_diffusers.py b/modules/prompt_parser_diffusers.py index 16980a636..905169ca8 100644 --- a/modules/prompt_parser_diffusers.py +++ b/modules/prompt_parser_diffusers.py @@ -118,15 +118,15 @@ def compel_encode_prompt( is_refiner: bool = None, clip_skip: typing.Optional[int] = None, ): - if shared.sd_model_type not in {"sd", "sdxl"}: - shared.log.warning(f"Prompt parser: Compel not supported: {type(pipeline).__name__}") + if 'StableDiffusion' not in pipeline.__class__.__name__: + shared.log.warning(f"Prompt parser: Compel not supported: {pipeline.__class__.__name__}") return (None, None, None, None) - if not is_refiner and shared.sd_model_type == "sdxl": + if 'XL' in pipeline.__class__.__name__ and not is_refiner: embedding_type = ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED if clip_skip is not None and clip_skip > 1: shared.log.warning(f"Prompt parser SDXL unsupported: clip_skip={clip_skip}") - elif is_refiner and shared.sd_refiner_type == "sdxl": + elif 'XL' in pipeline.__class__.__name__ and is_refiner: embedding_type = ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED if clip_skip is not None and clip_skip > 1: shared.log.warning(f"Prompt parser SDXL unsupported: clip_skip={clip_skip}") diff --git a/modules/sd_samplers_common.py b/modules/sd_samplers_common.py index f12d71cf3..4c2b3655a 100644 --- a/modules/sd_samplers_common.py +++ b/modules/sd_samplers_common.py @@ -30,11 +30,11 @@ def single_sample_to_image(sample, approximation=None): elif approximation == 1: x_sample = sd_vae_approx.model()(sample.to(devices.device, devices.dtype).unsqueeze(0))[0].detach() * 0.5 + 0.5 if shared.sd_model_type == "sdxl": - x_sample = x_sample[[2,1,0],:,:] #BGR to RGB + x_sample = x_sample[[2,1,0],:,:] # BGR to RGB elif approximation == 2: x_sample = sd_vae_approx.cheap_approximation(sample) * 0.5 + 0.5 if shared.sd_model_type == "sdxl": - x_sample = x_sample[[2,1,0],:,:] #BGR to RGB + x_sample = x_sample[[2,1,0],:,:] # BGR to RGB elif approximation == 3: # x_sample = sample * 1.5 # x_sample = sd_vae_taesd.model()(x_sample.to(devices.device, devices.dtype).unsqueeze(0))[0].detach() diff --git a/modules/sd_samplers_compvis.py b/modules/sd_samplers_compvis.py index c86c34bae..19fe750a1 100644 --- a/modules/sd_samplers_compvis.py +++ b/modules/sd_samplers_compvis.py @@ -121,10 +121,7 @@ class VanillaStableDiffusionSampler: return x, ts, cond, unconditional_conditioning def update_step(self, last_latent): - if self.mask is not None: - self.last_latent = self.init_latent * self.mask + self.nmask * last_latent - else: - self.last_latent = last_latent + self.last_latent = self.init_latent * self.mask + self.nmask * last_latent if self.mask is not None else last_latent sd_samplers_common.store_latent(self.last_latent) self.step += 1 state.sampling_step = self.step diff --git a/modules/sd_vae_approx.py b/modules/sd_vae_approx.py index 4a3bdf376..213926cdc 100644 --- a/modules/sd_vae_approx.py +++ b/modules/sd_vae_approx.py @@ -36,6 +36,7 @@ def model(): global sd_vae_approx_model # pylint: disable=global-statement if sd_vae_approx_model is None: + from modules.shared import log model_path = os.path.join(paths.models_path, "VAE-approx", "model.pt") sd_vae_approx_model = VAEApprox() if not os.path.exists(model_path): @@ -43,13 +44,13 @@ def model(): sd_vae_approx_model.load_state_dict(torch.load(model_path, map_location='cpu' if devices.device.type != 'cuda' else None)) sd_vae_approx_model.eval() sd_vae_approx_model.to(devices.device, devices.dtype) + log.info(f"Loaded VAE-approx model: {model_path}") return sd_vae_approx_model def cheap_approximation(sample): # https://discuss.huggingface.co/t/decoding-latents-to-rgb-without-upscaling/23204/2 - coefs = torch.tensor([ [0.298, 0.207, 0.208], [0.187, 0.286, 0.173], diff --git a/modules/taesd/sd_vae_taesd.py b/modules/taesd/sd_vae_taesd.py index 40151ba6b..179416624 100644 --- a/modules/taesd/sd_vae_taesd.py +++ b/modules/taesd/sd_vae_taesd.py @@ -28,10 +28,12 @@ def model(model_class = 'sd', model_type = 'decoder'): model_path = os.path.join(paths_internal.models_path, "TAESD", f"tae{model_class}_{model_type}.pth") download_model(model_path) if os.path.exists(model_path): + from modules.shared import log taesd_models[f'{model_class}-{model_type}'] = TAESD(decoder_path=model_path, encoder_path=None) if model_type == 'decoder' else TAESD(encoder_path=model_path, decoder_path=None) vae = taesd_models[f'{model_class}-{model_type}'] vae.eval() vae.to(devices.device, devices.dtype_vae) + log.info(f"Loaded VAE-approx model: {model_path}") else: raise FileNotFoundError('TAESD model not found') if vae is None: