From 561cde0a4d42fb97a4659e3755363df65b86f4e5 Mon Sep 17 00:00:00 2001 From: guozhong wang Date: Tue, 4 Jun 2024 16:27:08 +0800 Subject: [PATCH] using sdpa for statble diffusion (#458) Co-authored-by: Chen Peter --- llm_bench/python/convert.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/llm_bench/python/convert.py b/llm_bench/python/convert.py index 221752bcfc..eed79c7948 100644 --- a/llm_bench/python/convert.py +++ b/llm_bench/python/convert.py @@ -431,7 +431,6 @@ def _get_submodels_for_export_stable_diffusion( Returns the components of a Stable Diffusion model. """ from diffusers import StableDiffusionXLImg2ImgPipeline - from diffusers.models.attention_processor import AttnProcessor models_for_export = {} if isinstance(pipeline, StableDiffusionXLImg2ImgPipeline): @@ -450,7 +449,6 @@ def _get_submodels_for_export_stable_diffusion( # The U-NET time_ids inputs shapes depends on the value of `requires_aesthetics_score` # https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L571 pipeline.unet.config.requires_aesthetics_score = getattr(pipeline.config, "requires_aesthetics_score", False) - pipeline.unet.set_attn_processor(AttnProcessor()) models_for_export["unet"] = pipeline.unet # VAE Encoder https://github.com/huggingface/diffusers/blob/v0.11.1/src/diffusers/models/vae.py#L565