Added llm text encoder adapter

This commit is contained in:
Jaret Burkett
2025-02-13 08:28:32 -07:00
parent 2622de1e01
commit 7679105d52
4 changed files with 170 additions and 6 deletions

View File

@@ -1540,7 +1540,7 @@ class SDTrainer(BaseSDTrainProcess):
prior_pred = prior_pred.detach()
# do the custom adapter after the prior prediction
if self.adapter and isinstance(self.adapter, CustomAdapter) and has_clip_image:
if self.adapter and isinstance(self.adapter, CustomAdapter) and (has_clip_image or self.adapter_config.type in ['llm_adapter', 'text_encoder']):
quad_count = random.randint(1, 4)
self.adapter.train()
conditional_embeds = self.adapter.condition_encoded_embeds(