Replace trigger word in validation prompts for [trigger] tags
This commit is contained in:
1 parent
6e158dd1f1
commit
df354da23e
1 file changed
+8
-1
@@ -1612,7 +1612,14 @@ class BaseSDTrainProcess(BaseTrainProcess):
|
|||||||
img = transforms.CenterCrop(resolution)(img)
|
img = transforms.CenterCrop(resolution)(img)
|
||||||
tensor = transforms.ToTensor()(img) * 2.0 - 1.0
|
tensor = transforms.ToTensor()(img) * 2.0 - 1.0
|
||||||
image_list.append(tensor)
|
image_list.append(tensor)
|
||||||
prompt_list.append(item.prompt)
|
prompt = item.prompt
|
||||||
|
if self.trigger_word is not None:
|
||||||
|
prompt = self.sd.inject_trigger_into_prompt(
|
||||||
|
prompt,
|
||||||
|
trigger=self.trigger_word,
|
||||||
|
add_if_not_present=False,
|
||||||
|
)
|
||||||
|
prompt_list.append(prompt)
|
||||||
|
|
||||||
fork_devices = [device] if device.type == 'cuda' else []
|
fork_devices = [device] if device.type == 'cuda' else []
|
||||||
with torch.no_grad(), torch.random.fork_rng(devices=fork_devices):
|
with torch.no_grad(), torch.random.fork_rng(devices=fork_devices):
|
||||||
|
|||||||
Reference in new issue
Block a user