Fix case where text encoders where running on the CPU instead of GPU. (#11095)

This commit is contained in:
comfyanonymous
2025-12-03 20:15:15 -08:00
committed by GitHub
parent ecdc8697d5
commit ea17add3c6
2 changed files with 10 additions and 1 deletions

View File

@@ -193,6 +193,7 @@ class CLIP:
self.cond_stage_model.set_clip_options({"projected_pooled": False})
self.load_model()
self.cond_stage_model.set_clip_options({"execution_device": self.patcher.load_device})
all_hooks.reset()
self.patcher.patch_hooks(None)
if show_pbar:
@@ -240,6 +241,7 @@ class CLIP:
self.cond_stage_model.set_clip_options({"projected_pooled": False})
self.load_model()
self.cond_stage_model.set_clip_options({"execution_device": self.patcher.load_device})
o = self.cond_stage_model.encode_token_weights(tokens)
cond, pooled = o[:2]
if return_dict: