HunYuanDiT Fix text encoder device select

Fixes #47 and #50
This commit is contained in:
City
2024-05-25 16:44:58 +02:00
parent 1953a3bc99
commit e5c15ba479
3 changed files with 17 additions and 11 deletions
+2
View File
@@ -97,6 +97,7 @@ class HYDiTTextEncode:
def encode(self, text, text_t5, CLIP, T5):
# T5
T5.load_model()
t5_pre = T5.tokenizer(
text,
max_length = T5.cond_stage_model.max_length,
@@ -117,6 +118,7 @@ class HYDiTTextEncode:
t5_embs = t5_outs["hidden_states"][-1].float().cpu()
# "clip"
CLIP.load_model()
clip_pre = CLIP.tokenizer(
text,
max_length = CLIP.cond_stage_model.max_length,