Set clip vision model in eval mode so it works without inference mode.

This commit is contained in:
comfyanonymous 2023-12-15 18:53:08 -05:00
parent adc40e3d7b
commit 719fa0866f

View File

@ -39,6 +39,7 @@ class ClipVisionModel():
self.dtype = torch.float16 self.dtype = torch.float16
self.model = comfy.clip_model.CLIPVisionModelProjection(config, self.dtype, offload_device, comfy.ops.disable_weight_init) self.model = comfy.clip_model.CLIPVisionModelProjection(config, self.dtype, offload_device, comfy.ops.disable_weight_init)
self.model.eval()
self.patcher = comfy.model_patcher.ModelPatcher(self.model, load_device=self.load_device, offload_device=offload_device) self.patcher = comfy.model_patcher.ModelPatcher(self.model, load_device=self.load_device, offload_device=offload_device)
def load_sd(self, sd): def load_sd(self, sd):