From eacf5e34ebaa0ad9f1b7c8201b6da862a4436313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radam=C3=A9s=20Ajna?= Date: Tue, 5 Dec 2023 04:40:46 -0800 Subject: [PATCH] Fix demofusion (#6049) * Update pipeline_demofusion_sdxl.py * Update README.md --- examples/community/README.md | 10 +++++++--- examples/community/pipeline_demofusion_sdxl.py | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/community/README.md b/examples/community/README.md index 9fad6ecbf6..98780edecc 100755 --- a/examples/community/README.md +++ b/examples/community/README.md @@ -2870,10 +2870,14 @@ The original repo can be found at [repo](https://github.com/PRIS-CV/DemoFusion). - `show_image` (`bool`, defaults to False): Determine whether to show intermediate results during generation. ``` -from pipeline_demofusion_sdxl import DemoFusionSDXLPipeline +from diffusers import DiffusionPipeline -model_ckpt = "stabilityai/stable-diffusion-xl-base-1.0" -pipe = DemoFusionSDXLPipeline.from_pretrained(model_ckpt, torch_dtype=torch.float16) +pipe = DiffusionPipeline.from_pretrained( + "stabilityai/stable-diffusion-xl-base-1.0", + custom_pipeline="pipeline_demofusion_sdxl", + custom_revision="main", + torch_dtype=torch.float16, +) pipe = pipe.to("cuda") prompt = "Envision a portrait of an elderly woman, her face a canvas of time, framed by a headscarf with muted tones of rust and cream. Her eyes, blue like faded denim. Her attire, simple yet dignified." diff --git a/examples/community/pipeline_demofusion_sdxl.py b/examples/community/pipeline_demofusion_sdxl.py index 5a81320219..98508b7ff8 100644 --- a/examples/community/pipeline_demofusion_sdxl.py +++ b/examples/community/pipeline_demofusion_sdxl.py @@ -36,7 +36,9 @@ from diffusers.utils.torch_utils import randn_tensor if is_invisible_watermark_available(): - from .watermark import StableDiffusionXLWatermarker + from diffusers.pipelines.stable_diffusion_xl.watermark import ( + StableDiffusionXLWatermarker, + ) logger = logging.get_logger(__name__) # pylint: disable=invalid-name