mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
support comments in wildcard files
Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
- **Features**
|
||||
- **caption** tab support for Booru tagger models, thanks @CalamitousFelicitousness
|
||||
- add SmilingWolf WD14/WaifuDiffusion tagger models, thanks @CalamitousFelicitousness
|
||||
- support comments in wildcard files, using `#`
|
||||
- support aliases in metadata skip params, thanks @CalamitousFelicitousness
|
||||
- **Internal**
|
||||
- **cuda**: update to `torch==2.10.0`
|
||||
|
||||
+3
-1
@@ -144,8 +144,10 @@ def apply_file_wildcards(prompt, replaced = [], not_found = [], recursion=0, see
|
||||
try:
|
||||
with open(file, 'r', encoding='utf-8') as f:
|
||||
lines = f.readlines()
|
||||
lines = [line.split('#')[0].strip('\n').strip() for line in lines]
|
||||
lines = [line for line in lines if len(line) > 0]
|
||||
if len(lines) > 0:
|
||||
choice = random.choice(lines).strip(' \n')
|
||||
choice = random.choice(lines)
|
||||
if '|' in choice:
|
||||
choice = random.choice(choice.split('|')).strip(' []{}\n')
|
||||
prompt = prompt.replace(f"__{wildcard}__", choice, 1)
|
||||
|
||||
Reference in New Issue
Block a user