|
39 | 39 | "loaders": ["FromOriginalModelMixin"], |
40 | 40 | "models": [], |
41 | 41 | "pipelines": [], |
| 42 | + "modular_pipelines": [], |
42 | 43 | "quantizers.quantization_config": [], |
43 | 44 | "schedulers": [], |
44 | 45 | "utils": [ |
|
254 | 255 | "KarrasVePipeline", |
255 | 256 | "LDMPipeline", |
256 | 257 | "LDMSuperResolutionPipeline", |
257 | | - "ModularLoader", |
258 | 258 | "PNDMPipeline", |
259 | 259 | "RePaintPipeline", |
260 | 260 | "ScoreSdeVePipeline", |
261 | 261 | "StableDiffusionMixin", |
262 | 262 | ] |
263 | 263 | ) |
| 264 | + _import_structure["modular_pipelines"].extend( |
| 265 | + [ |
| 266 | + "ModularLoader", |
| 267 | + "ComponentSpec", |
| 268 | + "ComponentsManager", |
| 269 | + ] |
| 270 | + ) |
264 | 271 | _import_structure["quantizers"] = ["DiffusersQuantizer"] |
265 | 272 | _import_structure["schedulers"].extend( |
266 | 273 | [ |
|
509 | 516 | "StableDiffusionXLImg2ImgPipeline", |
510 | 517 | "StableDiffusionXLInpaintPipeline", |
511 | 518 | "StableDiffusionXLInstructPix2PixPipeline", |
512 | | - "StableDiffusionXLModularLoader", |
513 | 519 | "StableDiffusionXLPAGImg2ImgPipeline", |
514 | 520 | "StableDiffusionXLPAGInpaintPipeline", |
515 | 521 | "StableDiffusionXLPAGPipeline", |
516 | 522 | "StableDiffusionXLPipeline", |
517 | | - "StableDiffusionXLAutoPipeline", |
518 | 523 | "StableUnCLIPImg2ImgPipeline", |
519 | 524 | "StableUnCLIPPipeline", |
520 | 525 | "StableVideoDiffusionPipeline", |
|
541 | 546 | ] |
542 | 547 | ) |
543 | 548 |
|
| 549 | + |
| 550 | +try: |
| 551 | + if not (is_torch_available() and is_transformers_available()): |
| 552 | + raise OptionalDependencyNotAvailable() |
| 553 | +except OptionalDependencyNotAvailable: |
| 554 | + from .utils import dummy_torch_and_transformers_objects # noqa F403 |
| 555 | + |
| 556 | + _import_structure["utils.dummy_torch_and_transformers_objects"] = [ |
| 557 | + name for name in dir(dummy_torch_and_transformers_objects) if not name.startswith("_") |
| 558 | + ] |
| 559 | + |
| 560 | +else: |
| 561 | + _import_structure["modular_pipelines"].extend( |
| 562 | + [ |
| 563 | + "StableDiffusionXLAutoPipeline", |
| 564 | + "StableDiffusionXLModularLoader", |
| 565 | + ] |
| 566 | + ) |
544 | 567 | try: |
545 | 568 | if not (is_torch_available() and is_transformers_available() and is_opencv_available()): |
546 | 569 | raise OptionalDependencyNotAvailable() |
|
864 | 887 | KarrasVePipeline, |
865 | 888 | LDMPipeline, |
866 | 889 | LDMSuperResolutionPipeline, |
867 | | - ModularLoader, |
868 | 890 | PNDMPipeline, |
869 | 891 | RePaintPipeline, |
870 | 892 | ScoreSdeVePipeline, |
871 | 893 | StableDiffusionMixin, |
872 | 894 | ) |
| 895 | + from .modular_pipelines import ( |
| 896 | + ModularLoader, |
| 897 | + ComponentSpec, |
| 898 | + ComponentsManager, |
| 899 | + ) |
873 | 900 | from .quantizers import DiffusersQuantizer |
874 | 901 | from .schedulers import ( |
875 | 902 | AmusedScheduler, |
|
1097 | 1124 | StableDiffusionXLImg2ImgPipeline, |
1098 | 1125 | StableDiffusionXLInpaintPipeline, |
1099 | 1126 | StableDiffusionXLInstructPix2PixPipeline, |
1100 | | - StableDiffusionXLModularLoader, |
1101 | 1127 | StableDiffusionXLPAGImg2ImgPipeline, |
1102 | 1128 | StableDiffusionXLPAGInpaintPipeline, |
1103 | 1129 | StableDiffusionXLPAGPipeline, |
1104 | 1130 | StableDiffusionXLPipeline, |
1105 | | - StableDiffusionXLAutoPipeline, |
1106 | 1131 | StableUnCLIPImg2ImgPipeline, |
1107 | 1132 | StableUnCLIPPipeline, |
1108 | 1133 | StableVideoDiffusionPipeline, |
|
1127 | 1152 | WuerstchenDecoderPipeline, |
1128 | 1153 | WuerstchenPriorPipeline, |
1129 | 1154 | ) |
1130 | | - |
| 1155 | + try: |
| 1156 | + if not (is_torch_available() and is_transformers_available()): |
| 1157 | + raise OptionalDependencyNotAvailable() |
| 1158 | + except OptionalDependencyNotAvailable: |
| 1159 | + from .utils.dummy_torch_and_transformers_objects import * # noqa F403 |
| 1160 | + else: |
| 1161 | + from .modular_pipelines import ( |
| 1162 | + StableDiffusionXLAutoPipeline, |
| 1163 | + StableDiffusionXLModularLoader, |
| 1164 | + ) |
1131 | 1165 | try: |
1132 | 1166 | if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()): |
1133 | 1167 | raise OptionalDependencyNotAvailable() |
|
0 commit comments