mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
wildcards limit max recursion
This commit is contained in:
@@ -25,16 +25,18 @@ Thanks to @BinaryQuantumSoul for his hard work on this project!
|
||||
|
||||
### New built-in features
|
||||
|
||||
- HiDiffusion allows generating very-high resolution images out-of-the-box using standard models
|
||||
- Perturbed-Attention Guidance (PAG) enhances sample quality in addition to standard CFG scale
|
||||
- IP adapter masking allows to use multiple input images for each segment of the input image
|
||||
- IP adapter InstantStyle implementation
|
||||
- Token Downsampling (ToDO) provides significant speedups with minimal-to-none quality loss
|
||||
- Samplers optimizations that allow normal samplers to complete work in 1/3 of the steps!
|
||||
- **Gallery**: extremely fast built-in gallery viewer
|
||||
List, preview, search through all your images and videos!
|
||||
- **HiDiffusion** allows generating very-high resolution images out-of-the-box using standard models
|
||||
- **Perturbed-Attention Guidance** (PAG) enhances sample quality in addition to standard CFG scale
|
||||
- **IP adapter masking** allows to use multiple input images for each segment of the input image
|
||||
- IP adapter **InstantStyle** implementation
|
||||
- **Token Downsampling** (ToDO) provides significant speedups with minimal-to-none quality loss
|
||||
- **Samplers optimizations** that allow normal samplers to complete work in 1/3 of the steps!
|
||||
Yup, even popular DPM++2M can now run in 10 steps with quality equaling 30 steps
|
||||
- Native wildcards support
|
||||
- Improved built-in Face HiRes
|
||||
- Better outpainting
|
||||
- Native **wildcards** support
|
||||
- Improved built-in **Face HiRes**
|
||||
- Better **outpainting**
|
||||
- And much more...
|
||||
For details of above features and full list, see [Changelog](https://github.com/vladmandic/automatic/blob/dev/CHANGELOG.md)
|
||||
|
||||
|
||||
+4
-3
@@ -42,7 +42,7 @@ def apply_styles_to_prompt(prompt, styles):
|
||||
return prompt
|
||||
|
||||
|
||||
def apply_file_wildcards(prompt, replaced = [], not_found = []):
|
||||
def apply_file_wildcards(prompt, replaced = [], not_found = [], recursion=0):
|
||||
def check_files(prompt, wildcard, files):
|
||||
for file in files:
|
||||
if wildcard == os.path.splitext(os.path.basename(file))[0] if os.path.sep not in wildcard else wildcard in file:
|
||||
@@ -58,7 +58,8 @@ def apply_file_wildcards(prompt, replaced = [], not_found = []):
|
||||
return prompt, True
|
||||
return prompt, False
|
||||
|
||||
if not shared.opts.wildcards_enabled:
|
||||
recursion += 1
|
||||
if not shared.opts.wildcards_enabled or recursion >= 10:
|
||||
return prompt, replaced, not_found
|
||||
matches = re.findall(r'__(.*?)__', prompt, re.DOTALL)
|
||||
matches = [m for m in matches if m not in not_found]
|
||||
@@ -72,7 +73,7 @@ def apply_file_wildcards(prompt, replaced = [], not_found = []):
|
||||
not_found.remove(m)
|
||||
elif not found and m not in not_found:
|
||||
not_found.append(m)
|
||||
prompt, replaced, not_found = apply_file_wildcards(prompt, replaced, not_found) # recursive until we get early return
|
||||
prompt, replaced, not_found = apply_file_wildcards(prompt, replaced, not_found, recursion) # recursive until we get early return
|
||||
return prompt, replaced, not_found
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user