File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
src/diffusers/pipelines/stable_diffusion_xl Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 117
117
"torchvision" ,
118
118
"transformers>=4.25.1" ,
119
119
"urllib3<=2.0.0" ,
120
+ "invisible-watermark"
120
121
]
121
122
122
123
# this is a lookup table with items like:
@@ -207,6 +208,7 @@ def run(self):
207
208
"scipy" ,
208
209
"torchvision" ,
209
210
"transformers" ,
211
+ "invisible-watermark" ,
210
212
)
211
213
extras ["torch" ] = deps_list ("torch" , "accelerate" )
212
214
Original file line number Diff line number Diff line change 31
31
from ...utils import (
32
32
is_accelerate_available ,
33
33
is_accelerate_version ,
34
+ is_invisible_watermark_available ,
34
35
logging ,
35
36
randn_tensor ,
36
37
replace_example_docstring ,
37
38
)
38
39
from ..pipeline_utils import DiffusionPipeline
39
40
from . 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." )
41
47
42
48
43
49
logger = 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):
34
34
for backend in cls_module ._backends :
35
35
if backend == "k_diffusion" :
36
36
backend = "k-diffusion"
37
+ elif backend == "invisible_watermark" :
38
+ backend = "invisible-watermark"
37
39
assert backend in deps , f"{ backend } is not in the deps table!"
You can’t perform that action at this time.
0 commit comments