Skip to content

Commit

Permalink
Merge pull request #1940 from Mikubill/dev
Browse files Browse the repository at this point in the history
fix cond cache problem for a1111 1.6.x
  • Loading branch information
lllyasviel authored Aug 22, 2023
2 parents 7c61836 + 80a5bb9 commit c5b8de0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/controlnet_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version_flag = 'v1.1.300'
version_flag = 'v1.1.301'

from scripts.logging import logger

Expand Down
5 changes: 5 additions & 0 deletions scripts/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ldm.models.diffusion.ddpm import extract_into_tensor

from modules.prompt_parser import MulticondLearnedConditioning, ComposableScheduledPromptConditioning, ScheduledPromptConditioning
from modules.processing import StableDiffusionProcessing


POSITIVE_MARK_TOKEN = 1024
Expand Down Expand Up @@ -83,6 +84,10 @@ def unmark_prompt_context(x):
mark_batch = mark[:, None, None, None].to(x.dtype).to(x.device)
uc_indices = mark.detach().cpu().numpy().tolist()
uc_indices = [i for i, item in enumerate(uc_indices) if item < 0.5]

StableDiffusionProcessing.cached_c = [None, None]
StableDiffusionProcessing.cached_uc = [None, None]

return mark_batch, uc_indices, context


Expand Down

0 comments on commit c5b8de0

Please sign in to comment.