diff --git a/optimum/intel/openvino/modeling_diffusion.py b/optimum/intel/openvino/modeling_diffusion.py index 1085c9e81c..da1bde6dbb 100644 --- a/optimum/intel/openvino/modeling_diffusion.py +++ b/optimum/intel/openvino/modeling_diffusion.py @@ -606,6 +606,11 @@ def __call__(self, latent_sample: np.ndarray): outputs = self.request(inputs, shared_memory=True) return list(outputs.values()) + def _compile(self): + if "GPU" in self.device: + self.ov_config.update({"INFERENCE_PRECISION_HINT": "f32"}) + super()._compile() + class OVModelVaeEncoder(OVModelPart): def __init__( @@ -622,6 +627,11 @@ def __call__(self, sample: np.ndarray): outputs = self.request(inputs, shared_memory=True) return list(outputs.values()) + def _compile(self): + if "GPU" in self.device: + self.ov_config.update({"INFERENCE_PRECISION_HINT": "f32"}) + super()._compile() + class OVStableDiffusionPipeline(OVStableDiffusionPipelineBase, StableDiffusionPipelineMixin): def __call__(