From dff846182f32f4182be64c76766ed71e63756335 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 22 Dec 2024 08:20:16 -0500 Subject: [PATCH] fix wildcards Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 7 ++++--- modules/processing_vae.py | 3 ++- modules/styles.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90eda3736..83eda417d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Change Log for SD.Next -## Update for 2024-12-21 +## Update for 2024-12-22 -### Highlights for 2024-12-21 +### Highlights for 2024-12-22 ### SD.Next Xmass edition: *What's new?* @@ -32,7 +32,7 @@ All-in-all, we're around ~160 commits worth of updates, check changelog for full [ReadMe](https://github.com/vladmandic/automatic/blob/master/README.md) | [ChangeLog](https://github.com/vladmandic/automatic/blob/master/CHANGELOG.md) | [Docs](https://vladmandic.github.io/sdnext-docs/) | [WiKi](https://github.com/vladmandic/automatic/wiki) | [Discord](https://discord.com/invite/sd-next-federal-batch-inspectors-1101998836328697867) -## Details for 2024-12-21 +## Details for 2024-12-22 ### New models and integrations @@ -217,6 +217,7 @@ All-in-all, we're around ~160 commits worth of updates, check changelog for full - fix xyz-grid with lora none - fix svd image2video - fix gallery display during generate +- fix wildcards replacement to be unique ## Update for 2024-11-21 diff --git a/modules/processing_vae.py b/modules/processing_vae.py index 772a48adc..5d8f9fc84 100644 --- a/modules/processing_vae.py +++ b/modules/processing_vae.py @@ -144,7 +144,8 @@ def full_vae_decode(latents, model): decoded = model.vae.decode(latents, return_dict=False)[0] except Exception as e: shared.log.error(f'VAE decode: {stats} {e}') - errors.display(e, 'VAE decode') + if 'out of memory' not in str(e): + errors.display(e, 'VAE decode') decoded = [] if hasattr(model.vae, "orig_dtype"): diff --git a/modules/styles.py b/modules/styles.py index 0dd48eb7f..d0228d33a 100644 --- a/modules/styles.py +++ b/modules/styles.py @@ -52,7 +52,7 @@ def apply_file_wildcards(prompt, replaced = [], not_found = [], recursion=0, see choice = random.choice(lines).strip(' \n') if '|' in choice: choice = random.choice(choice.split('|')).strip(' []{}\n') - prompt = prompt.replace(f"__{wildcard}__", choice) + prompt = prompt.replace(f"__{wildcard}__", choice, 1) shared.log.debug(f'Wildcards apply: wildcard="{wildcard}" choice="{choice}" file="{file}" choices={len(lines)}') replaced.append(wildcard) return prompt, True