diff --git a/extensions_built_in/sd_trainer/SDTrainer.py b/extensions_built_in/sd_trainer/SDTrainer.py index 196e1323..f8e7b8ec 100644 --- a/extensions_built_in/sd_trainer/SDTrainer.py +++ b/extensions_built_in/sd_trainer/SDTrainer.py @@ -1930,9 +1930,8 @@ class SDTrainer(BaseSDTrainProcess): encoded = {} for source_name, prompts in source_prompts.items(): with self._activator_mode('full'): - active_embeds = self.sd.encode_prompt( + active_embeds = self.sd.get_prompt_embeds( prompts, - long_prompts=self.do_long_prompts, return_taps=context_config.enabled, ) active_pred = self.predict_noise( @@ -1946,9 +1945,8 @@ class SDTrainer(BaseSDTrainProcess): ) with self._activator_mode('activator_bypass'): with torch.no_grad(): - bypass_embeds = self.sd.encode_prompt( + bypass_embeds = self.sd.get_prompt_embeds( prompts, - long_prompts=self.do_long_prompts, return_taps=context_config.enabled, ).detach() bypass_pred = self.predict_noise( diff --git a/testing/test_sd_trainer_three_phase_runtime.py b/testing/test_sd_trainer_three_phase_runtime.py index 80e00571..2b71ec09 100644 --- a/testing/test_sd_trainer_three_phase_runtime.py +++ b/testing/test_sd_trainer_three_phase_runtime.py @@ -331,7 +331,7 @@ class ThreePhaseRuntimeTest(unittest.TestCase): trainer.do_long_prompts = False trainer.additional_logs = {} trainer.sd = SimpleNamespace( - encode_prompt=lambda prompts, **kwargs: _FakeEmbeds(len(prompts)), + get_prompt_embeds=lambda prompts, **kwargs: _FakeEmbeds(len(prompts)), get_loss_target=lambda noise, batch, timesteps: noise + 1, ) calls = [] @@ -397,7 +397,7 @@ class ThreePhaseRuntimeTest(unittest.TestCase): return embeds trainer.sd = SimpleNamespace( - encode_prompt=encode, + get_prompt_embeds=encode, get_loss_target=lambda noise, batch, timesteps: noise, ) trainer.predict_noise = lambda noisy_latents, **kwargs: (