|
14 | 14 | is_librosa_available, |
15 | 15 | is_note_seq_available, |
16 | 16 | is_onnx_available, |
| 17 | + is_opencv_available, |
17 | 18 | is_optimum_quanto_available, |
18 | 19 | is_scipy_available, |
19 | 20 | is_sentencepiece_available, |
|
352 | 353 | "CogView3PlusPipeline", |
353 | 354 | "CogView4ControlPipeline", |
354 | 355 | "CogView4Pipeline", |
355 | | - "ConsisIDPipeline", |
356 | 356 | "CycleDiffusionPipeline", |
357 | 357 | "EasyAnimateControlPipeline", |
358 | 358 | "EasyAnimateInpaintPipeline", |
|
518 | 518 | ] |
519 | 519 | ) |
520 | 520 |
|
| 521 | +try: |
| 522 | + if not (is_torch_available() and is_transformers_available() and is_opencv_available()): |
| 523 | + raise OptionalDependencyNotAvailable() |
| 524 | +except OptionalDependencyNotAvailable: |
| 525 | + from .utils import dummy_torch_and_transformers_and_opencv_objects # noqa F403 |
| 526 | + |
| 527 | + _import_structure["utils.dummy_torch_and_transformers_and_opencv_objects"] = [ |
| 528 | + name for name in dir(dummy_torch_and_transformers_and_opencv_objects) if not name.startswith("_") |
| 529 | + ] |
| 530 | + |
| 531 | +else: |
| 532 | + _import_structure["pipelines"].extend(["ConsisIDPipeline"]) |
| 533 | + |
521 | 534 | try: |
522 | 535 | if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()): |
523 | 536 | raise OptionalDependencyNotAvailable() |
|
909 | 922 | CogView3PlusPipeline, |
910 | 923 | CogView4ControlPipeline, |
911 | 924 | CogView4Pipeline, |
912 | | - ConsisIDPipeline, |
913 | 925 | CycleDiffusionPipeline, |
914 | 926 | EasyAnimateControlPipeline, |
915 | 927 | EasyAnimateInpaintPipeline, |
|
1088 | 1100 | from .utils.dummy_torch_and_transformers_and_sentencepiece_objects import * # noqa F403 |
1089 | 1101 | else: |
1090 | 1102 | from .pipelines import KolorsImg2ImgPipeline, KolorsPAGPipeline, KolorsPipeline |
| 1103 | + |
| 1104 | + try: |
| 1105 | + if not (is_torch_available() and is_transformers_available() and is_opencv_available()): |
| 1106 | + raise OptionalDependencyNotAvailable() |
| 1107 | + except OptionalDependencyNotAvailable: |
| 1108 | + from .utils.dummy_torch_and_transformers_and_opencv_objects import * # noqa F403 |
| 1109 | + else: |
| 1110 | + from .pipelines import ConsisIDPipeline |
| 1111 | + |
1091 | 1112 | try: |
1092 | 1113 | if not (is_torch_available() and is_transformers_available() and is_onnx_available()): |
1093 | 1114 | raise OptionalDependencyNotAvailable() |
|
0 commit comments