@@ -528,7 +528,12 @@ def from_pipe(cls, pipeline, **kwargs):
528528 if k not in text_2_image_kwargs
529529 }
530530
531- missing_modules = set (expected_modules ) - set (pipeline ._optional_components ) - set (text_2_image_kwargs .keys ())
531+ missing_modules = (
532+ set (expected_modules )
533+ - set (pipeline ._optional_components )
534+ - set (text_2_image_cls ._optional_components )
535+ - set (text_2_image_kwargs .keys ())
536+ )
532537
533538 if len (missing_modules ) > 0 :
534539 raise ValueError (
@@ -838,7 +843,12 @@ def from_pipe(cls, pipeline, **kwargs):
838843 if k not in image_2_image_kwargs
839844 }
840845
841- missing_modules = set (expected_modules ) - set (pipeline ._optional_components ) - set (image_2_image_kwargs .keys ())
846+ missing_modules = (
847+ set (expected_modules )
848+ - set (pipeline ._optional_components )
849+ - set (image_2_image_cls ._optional_components )
850+ - set (image_2_image_kwargs .keys ())
851+ )
842852
843853 if len (missing_modules ) > 0 :
844854 raise ValueError (
@@ -1141,7 +1151,12 @@ def from_pipe(cls, pipeline, **kwargs):
11411151 if k not in inpainting_kwargs
11421152 }
11431153
1144- missing_modules = set (expected_modules ) - set (pipeline ._optional_components ) - set (inpainting_kwargs .keys ())
1154+ missing_modules = (
1155+ set (expected_modules )
1156+ - set (pipeline ._optional_components )
1157+ - set (inpainting_cls ._optional_components )
1158+ - set (inpainting_kwargs .keys ())
1159+ )
11451160
11461161 if len (missing_modules ) > 0 :
11471162 raise ValueError (
0 commit comments