Added long prompts to general training
This commit is contained in:
@@ -285,7 +285,7 @@ class SDTrainer(BaseSDTrainProcess):
|
|||||||
with self.timer('encode_prompt'):
|
with self.timer('encode_prompt'):
|
||||||
if grad_on_text_encoder:
|
if grad_on_text_encoder:
|
||||||
with torch.set_grad_enabled(True):
|
with torch.set_grad_enabled(True):
|
||||||
conditional_embeds = self.sd.encode_prompt(conditioned_prompts).to(
|
conditional_embeds = self.sd.encode_prompt(conditioned_prompts, long_prompts=True).to(
|
||||||
self.device_torch,
|
self.device_torch,
|
||||||
dtype=dtype)
|
dtype=dtype)
|
||||||
else:
|
else:
|
||||||
@@ -296,7 +296,7 @@ class SDTrainer(BaseSDTrainProcess):
|
|||||||
te.eval()
|
te.eval()
|
||||||
else:
|
else:
|
||||||
self.sd.text_encoder.eval()
|
self.sd.text_encoder.eval()
|
||||||
conditional_embeds = self.sd.encode_prompt(conditioned_prompts).to(
|
conditional_embeds = self.sd.encode_prompt(conditioned_prompts, long_prompts=True).to(
|
||||||
self.device_torch,
|
self.device_torch,
|
||||||
dtype=dtype)
|
dtype=dtype)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user