Skip to content

Commit 86068a5

Browse files
authored
Text2Image SDXL fix for GPU (openvinotoolkit#1266)
CVS-156801
1 parent fa1e95e commit 86068a5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/cpp/src/image_generation/stable_diffusion_xl_pipeline.hpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,19 @@ class StableDiffusionXLPipeline : public DiffusionPipeline {
111111
OPENVINO_THROW("Unsupported '", unet, "' UNet type");
112112
}
113113

114+
// Temporary fix for GPU
115+
ov::AnyMap updated_roperties = properties;
116+
if (device.find("GPU") != std::string::npos &&
117+
updated_roperties.find("INFERENCE_PRECISION_HINT") == updated_roperties.end()) {
118+
updated_roperties["INFERENCE_PRECISION_HINT"] = ov::element::f32;
119+
}
120+
114121
const std::string vae = data["vae"][1].get<std::string>();
115122
if (vae == "AutoencoderKL") {
116123
if (m_pipeline_type == PipelineType::TEXT_2_IMAGE)
117-
m_vae = std::make_shared<AutoencoderKL>(root_dir / "vae_decoder", device, properties);
124+
m_vae = std::make_shared<AutoencoderKL>(root_dir / "vae_decoder", device, updated_roperties);
118125
else if (m_pipeline_type == PipelineType::IMAGE_2_IMAGE) {
119-
m_vae = std::make_shared<AutoencoderKL>(root_dir / "vae_encoder", root_dir / "vae_decoder", device, properties);
126+
m_vae = std::make_shared<AutoencoderKL>(root_dir / "vae_encoder", root_dir / "vae_decoder", device, updated_roperties);
120127
} else {
121128
OPENVINO_ASSERT("Unsupported pipeline type");
122129
}

0 commit comments

Comments
 (0)