Skip to content

Commit 0846f9e

Browse files
authored
Merge pull request #161 from intel/gpu_precision_fix
Fix SD1.5 FP16 for some ARL and MTL GPU SKUs.
2 parents 6c5284c + 23a1ce1 commit 0846f9e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gimpopenvino/plugins/openvino_utils/tools/openvino_common/models_ov/stable_diffusion_engine.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,15 @@ def __init__(
523523

524524
self.set_dimensions()
525525

526-
527-
528526
def load_model(self, model, model_name, device):
529527
if "NPU" in device:
530528
with open(os.path.join(model, f"{model_name}.blob"), "rb") as f:
531529
return self.core.import_model(f.read(), device)
532-
return self.core.compile_model(os.path.join(model, f"{model_name}.xml"), device)
530+
if "GPU" in device:
531+
return self.core.compile_model(os.path.join(model, f"{model_name}.xml"), device, {'INFERENCE_PRECISION_HINT': 'f32'})
532+
else:
533+
return self.core.compile_model(os.path.join(model, f"{model_name}.xml"), device)
534+
533535

534536
def set_dimensions(self):
535537
latent_shape = self.unet.input(self.unet_input_tensor_name).shape

0 commit comments

Comments
 (0)