|
19 | 19 |
|
20 | 20 | from ..configuration_utils import ConfigMixin |
21 | 21 | from ..models.controlnets import ControlNetUnionModel |
22 | | -from ..utils import is_sentencepiece_available |
| 22 | +from ..utils import is_sentencepiece_available, logging |
23 | 23 | from .aura_flow import AuraFlowPipeline |
24 | 24 | from .cogview3 import CogView3PlusPipeline |
25 | 25 | from .controlnet import ( |
|
101 | 101 | from .wuerstchen import WuerstchenCombinedPipeline, WuerstchenDecoderPipeline |
102 | 102 |
|
103 | 103 |
|
| 104 | +logger = logging.get_logger(__name__) |
| 105 | + |
| 106 | + |
104 | 107 | AUTO_TEXT2IMAGE_PIPELINES_MAPPING = OrderedDict( |
105 | 108 | [ |
106 | 109 | ("stable-diffusion", StableDiffusionPipeline), |
@@ -528,7 +531,12 @@ def from_pipe(cls, pipeline, **kwargs): |
528 | 531 | if k not in text_2_image_kwargs |
529 | 532 | } |
530 | 533 |
|
531 | | - missing_modules = set(expected_modules) - set(pipeline._optional_components) - set(text_2_image_kwargs.keys()) |
| 534 | + missing_modules = ( |
| 535 | + set(expected_modules) |
| 536 | + - set(pipeline._optional_components) |
| 537 | + - set(text_2_image_cls._optional_components) |
| 538 | + - set(text_2_image_kwargs.keys()) |
| 539 | + ) |
532 | 540 |
|
533 | 541 | if len(missing_modules) > 0: |
534 | 542 | raise ValueError( |
@@ -838,7 +846,12 @@ def from_pipe(cls, pipeline, **kwargs): |
838 | 846 | if k not in image_2_image_kwargs |
839 | 847 | } |
840 | 848 |
|
841 | | - missing_modules = set(expected_modules) - set(pipeline._optional_components) - set(image_2_image_kwargs.keys()) |
| 849 | + missing_modules = ( |
| 850 | + set(expected_modules) |
| 851 | + - set(pipeline._optional_components) |
| 852 | + - set(image_2_image_cls._optional_components) |
| 853 | + - set(image_2_image_kwargs.keys()) |
| 854 | + ) |
842 | 855 |
|
843 | 856 | if len(missing_modules) > 0: |
844 | 857 | raise ValueError( |
@@ -1141,7 +1154,12 @@ def from_pipe(cls, pipeline, **kwargs): |
1141 | 1154 | if k not in inpainting_kwargs |
1142 | 1155 | } |
1143 | 1156 |
|
1144 | | - missing_modules = set(expected_modules) - set(pipeline._optional_components) - set(inpainting_kwargs.keys()) |
| 1157 | + missing_modules = ( |
| 1158 | + set(expected_modules) |
| 1159 | + - set(pipeline._optional_components) |
| 1160 | + - set(inpainting_cls._optional_components) |
| 1161 | + - set(inpainting_kwargs.keys()) |
| 1162 | + ) |
1145 | 1163 |
|
1146 | 1164 | if len(missing_modules) > 0: |
1147 | 1165 | raise ValueError( |
|
0 commit comments