From edd766e70ae3ea8039e7b9e24d55fbd26792ef10 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Mon, 29 May 2023 05:40:38 +0900 Subject: [PATCH 1/3] fix xyz clip --- scripts/xyz_grid.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index 7821cc65..00a81060 100644 --- a/scripts/xyz_grid.py +++ b/scripts/xyz_grid.py @@ -94,7 +94,10 @@ def confirm_checkpoints(p, xs): def apply_clip_skip(p, x, xs): - opts.data["CLIP_stop_at_last_layers"] = x + if opts.data["CLIP_stop_at_last_layers"] != x: + opts.data["CLIP_stop_at_last_layers"] = x + p.cached_c = [None, None] + p.cached_uc = [None, None] def apply_upscale_latent_space(p, x, xs): From 123641e4ec93c0cd99f7ab03f4f39ca8ae4b4cef Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Tue, 30 May 2023 01:06:23 +0900 Subject: [PATCH 2/3] Revert "fix xyz clip" This reverts commit edd766e70ae3ea8039e7b9e24d55fbd26792ef10. --- scripts/xyz_grid.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index 00a81060..7821cc65 100644 --- a/scripts/xyz_grid.py +++ b/scripts/xyz_grid.py @@ -94,10 +94,7 @@ def confirm_checkpoints(p, xs): def apply_clip_skip(p, x, xs): - if opts.data["CLIP_stop_at_last_layers"] != x: - opts.data["CLIP_stop_at_last_layers"] = x - p.cached_c = [None, None] - p.cached_uc = [None, None] + opts.data["CLIP_stop_at_last_layers"] = x def apply_upscale_latent_space(p, x, xs): From 4a449375a20267035402eed5d93074c2f0a91bc8 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Tue, 30 May 2023 01:07:35 +0900 Subject: [PATCH 3/3] fix get_conds_with_caching() --- modules/processing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/processing.py b/modules/processing.py index b75f2515..395c851f 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -321,14 +321,13 @@ class StableDiffusionProcessing: have been used before. The second element is where the previously computed result is stored. """ - - if cache[0] is not None and (required_prompts, steps) == cache[0]: + if cache[0] is not None and (required_prompts, steps, opts.CLIP_stop_at_last_layers, shared.sd_model.sd_checkpoint_info) == cache[0]: return cache[1] with devices.autocast(): cache[1] = function(shared.sd_model, required_prompts, steps) - cache[0] = (required_prompts, steps) + cache[0] = (required_prompts, steps, opts.CLIP_stop_at_last_layers, shared.sd_model.sd_checkpoint_info) return cache[1] def setup_conds(self):