File tree Expand file tree Collapse file tree
src/diffusers/pipelines/stable_diffusion_xl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 117117 "torchvision" ,
118118 "transformers>=4.25.1" ,
119119 "urllib3<=2.0.0" ,
120+ "invisible-watermark"
120121]
121122
122123# this is a lookup table with items like:
@@ -207,6 +208,7 @@ def run(self):
207208 "scipy" ,
208209 "torchvision" ,
209210 "transformers" ,
211+ "invisible-watermark" ,
210212)
211213extras ["torch" ] = deps_list ("torch" , "accelerate" )
212214
Original file line number Diff line number Diff line change 3131from ...utils import (
3232 is_accelerate_available ,
3333 is_accelerate_version ,
34+ is_invisible_watermark_available ,
3435 logging ,
3536 randn_tensor ,
3637 replace_example_docstring ,
3738)
3839from ..pipeline_utils import DiffusionPipeline
3940from . import StableDiffusionXLPipelineOutput
40- from .watermark import StableDiffusionXLWatermarker
41+
42+
43+ if is_invisible_watermark_available ():
44+ from .watermark import StableDiffusionXLWatermarker
45+ else :
46+ raise ImportError ("StableDiffusionXLWatermarker requires the `invisible-watermark` library installed." )
4147
4248
4349logger = logging .get_logger (__name__ ) # pylint: disable=invalid-name
Original file line number Diff line number Diff line change @@ -34,4 +34,6 @@ def test_backend_registration(self):
3434 for backend in cls_module ._backends :
3535 if backend == "k_diffusion" :
3636 backend = "k-diffusion"
37+ elif backend == "invisible_watermark" :
38+ backend = "invisible-watermark"
3739 assert backend in deps , f"{ backend } is not in the deps table!"
You can’t perform that action at this time.
0 commit comments