mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-02-11 08:02:53 +08:00
resolve [name] after resolving [filewords] in training
This commit is contained in:
parent
98947d173e
commit
9a1aff645a
@ -97,13 +97,13 @@ class PersonalizedBase(Dataset):
|
|||||||
|
|
||||||
def create_text(self, filename_text):
|
def create_text(self, filename_text):
|
||||||
text = random.choice(self.lines)
|
text = random.choice(self.lines)
|
||||||
text = text.replace("[name]", self.placeholder_token)
|
|
||||||
tags = filename_text.split(',')
|
tags = filename_text.split(',')
|
||||||
if shared.opts.tag_drop_out != 0:
|
if shared.opts.tag_drop_out != 0:
|
||||||
tags = [t for t in tags if random.random() > shared.opts.tag_drop_out]
|
tags = [t for t in tags if random.random() > shared.opts.tag_drop_out]
|
||||||
if shared.opts.shuffle_tags:
|
if shared.opts.shuffle_tags:
|
||||||
random.shuffle(tags)
|
random.shuffle(tags)
|
||||||
text = text.replace("[filewords]", ','.join(tags))
|
text = text.replace("[filewords]", ','.join(tags))
|
||||||
|
text = text.replace("[name]", self.placeholder_token)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user