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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__version__ = "0.31.0.dev0"
|
| 2 |
+
|
| 3 |
+
from typing import TYPE_CHECKING
|
| 4 |
+
|
| 5 |
+
from .utils import (
|
| 6 |
+
DIFFUSERS_SLOW_IMPORT,
|
| 7 |
+
OptionalDependencyNotAvailable,
|
| 8 |
+
_LazyModule,
|
| 9 |
+
is_flax_available,
|
| 10 |
+
is_k_diffusion_available,
|
| 11 |
+
is_librosa_available,
|
| 12 |
+
is_note_seq_available,
|
| 13 |
+
is_onnx_available,
|
| 14 |
+
is_scipy_available,
|
| 15 |
+
is_sentencepiece_available,
|
| 16 |
+
is_torch_available,
|
| 17 |
+
is_torchsde_available,
|
| 18 |
+
is_transformers_available,
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
# Lazy Import based on
|
| 23 |
+
# https://github.com/huggingface/transformers/blob/main/src/transformers/__init__.py
|
| 24 |
+
|
| 25 |
+
# When adding a new object to this init, please add it to `_import_structure`. The `_import_structure` is a dictionary submodule to list of object names,
|
| 26 |
+
# and is used to defer the actual importing for when the objects are requested.
|
| 27 |
+
# This way `import diffusers` provides the names in the namespace without actually importing anything (and especially none of the backends).
|
| 28 |
+
|
| 29 |
+
_import_structure = {
|
| 30 |
+
"configuration_utils": ["ConfigMixin"],
|
| 31 |
+
"loaders": ["FromOriginalModelMixin"],
|
| 32 |
+
"models": [],
|
| 33 |
+
"pipelines": [],
|
| 34 |
+
"schedulers": [],
|
| 35 |
+
"utils": [
|
| 36 |
+
"OptionalDependencyNotAvailable",
|
| 37 |
+
"is_flax_available",
|
| 38 |
+
"is_inflect_available",
|
| 39 |
+
"is_invisible_watermark_available",
|
| 40 |
+
"is_k_diffusion_available",
|
| 41 |
+
"is_k_diffusion_version",
|
| 42 |
+
"is_librosa_available",
|
| 43 |
+
"is_note_seq_available",
|
| 44 |
+
"is_onnx_available",
|
| 45 |
+
"is_scipy_available",
|
| 46 |
+
"is_torch_available",
|
| 47 |
+
"is_torchsde_available",
|
| 48 |
+
"is_transformers_available",
|
| 49 |
+
"is_transformers_version",
|
| 50 |
+
"is_unidecode_available",
|
| 51 |
+
"logging",
|
| 52 |
+
],
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
try:
|
| 56 |
+
if not is_onnx_available():
|
| 57 |
+
raise OptionalDependencyNotAvailable()
|
| 58 |
+
except OptionalDependencyNotAvailable:
|
| 59 |
+
from .utils import dummy_onnx_objects # noqa F403
|
| 60 |
+
|
| 61 |
+
_import_structure["utils.dummy_onnx_objects"] = [
|
| 62 |
+
name for name in dir(dummy_onnx_objects) if not name.startswith("_")
|
| 63 |
+
]
|
| 64 |
+
|
| 65 |
+
else:
|
| 66 |
+
_import_structure["pipelines"].extend(["OnnxRuntimeModel"])
|
| 67 |
+
|
| 68 |
+
try:
|
| 69 |
+
if not is_torch_available():
|
| 70 |
+
raise OptionalDependencyNotAvailable()
|
| 71 |
+
except OptionalDependencyNotAvailable:
|
| 72 |
+
from .utils import dummy_pt_objects # noqa F403
|
| 73 |
+
|
| 74 |
+
_import_structure["utils.dummy_pt_objects"] = [name for name in dir(dummy_pt_objects) if not name.startswith("_")]
|
| 75 |
+
|
| 76 |
+
else:
|
| 77 |
+
_import_structure["models"].extend(
|
| 78 |
+
[
|
| 79 |
+
"AsymmetricAutoencoderKL",
|
| 80 |
+
"AuraFlowTransformer2DModel",
|
| 81 |
+
"AutoencoderKL",
|
| 82 |
+
"AutoencoderKLCogVideoX",
|
| 83 |
+
"AutoencoderKLTemporalDecoder",
|
| 84 |
+
"AutoencoderOobleck",
|
| 85 |
+
"AutoencoderTiny",
|
| 86 |
+
"CogVideoXTransformer3DModel",
|
| 87 |
+
"ConsistencyDecoderVAE",
|
| 88 |
+
"ControlNetModel",
|
| 89 |
+
"ControlNetXSAdapter",
|
| 90 |
+
"DiTTransformer2DModel",
|
| 91 |
+
"FluxControlNetModel",
|
| 92 |
+
"FluxMultiControlNetModel",
|
| 93 |
+
"FluxTransformer2DModel",
|
| 94 |
+
"HunyuanDiT2DControlNetModel",
|
| 95 |
+
"HunyuanDiT2DModel",
|
| 96 |
+
"HunyuanDiT2DMultiControlNetModel",
|
| 97 |
+
"I2VGenXLUNet",
|
| 98 |
+
"Kandinsky3UNet",
|
| 99 |
+
"LatteTransformer3DModel",
|
| 100 |
+
"LuminaNextDiT2DModel",
|
| 101 |
+
"ModelMixin",
|
| 102 |
+
"MotionAdapter",
|
| 103 |
+
"MultiAdapter",
|
| 104 |
+
"PixArtTransformer2DModel",
|
| 105 |
+
"PriorTransformer",
|
| 106 |
+
"SD3ControlNetModel",
|
| 107 |
+
"SD3MultiControlNetModel",
|
| 108 |
+
"SD3Transformer2DModel",
|
| 109 |
+
"SparseControlNetModel",
|
| 110 |
+
"StableAudioDiTModel",
|
| 111 |
+
"StableCascadeUNet",
|
| 112 |
+
"T2IAdapter",
|
| 113 |
+
"T5FilmDecoder",
|
| 114 |
+
"Transformer2DModel",
|
| 115 |
+
"UNet1DModel",
|
| 116 |
+
"UNet2DConditionModel",
|
| 117 |
+
"UNet2DModel",
|
| 118 |
+
"UNet3DConditionModel",
|
| 119 |
+
"UNetControlNetXSModel",
|
| 120 |
+
"UNetMotionModel",
|
| 121 |
+
"UNetSpatioTemporalConditionModel",
|
| 122 |
+
"UVit2DModel",
|
| 123 |
+
"VQModel",
|
| 124 |
+
]
|
| 125 |
+
)
|
| 126 |
+
|
| 127 |
+
_import_structure["optimization"] = [
|
| 128 |
+
"get_constant_schedule",
|
| 129 |
+
"get_constant_schedule_with_warmup",
|
| 130 |
+
"get_cosine_schedule_with_warmup",
|
| 131 |
+
"get_cosine_with_hard_restarts_schedule_with_warmup",
|
| 132 |
+
"get_linear_schedule_with_warmup",
|
| 133 |
+
"get_polynomial_decay_schedule_with_warmup",
|
| 134 |
+
"get_scheduler",
|
| 135 |
+
]
|
| 136 |
+
_import_structure["pipelines"].extend(
|
| 137 |
+
[
|
| 138 |
+
"AudioPipelineOutput",
|
| 139 |
+
"AutoPipelineForImage2Image",
|
| 140 |
+
"AutoPipelineForInpainting",
|
| 141 |
+
"AutoPipelineForText2Image",
|
| 142 |
+
"ConsistencyModelPipeline",
|
| 143 |
+
"DanceDiffusionPipeline",
|
| 144 |
+
"DDIMPipeline",
|
| 145 |
+
"DDPMPipeline",
|
| 146 |
+
"DiffusionPipeline",
|
| 147 |
+
"DiTPipeline",
|
| 148 |
+
"ImagePipelineOutput",
|
| 149 |
+
"KarrasVePipeline",
|
| 150 |
+
"LDMPipeline",
|
| 151 |
+
"LDMSuperResolutionPipeline",
|
| 152 |
+
"PNDMPipeline",
|
| 153 |
+
"RePaintPipeline",
|
| 154 |
+
"ScoreSdeVePipeline",
|
| 155 |
+
"StableDiffusionMixin",
|
| 156 |
+
]
|
| 157 |
+
)
|
| 158 |
+
_import_structure["schedulers"].extend(
|
| 159 |
+
[
|
| 160 |
+
"AmusedScheduler",
|
| 161 |
+
"CMStochasticIterativeScheduler",
|
| 162 |
+
"CogVideoXDDIMScheduler",
|
| 163 |
+
"CogVideoXDPMScheduler",
|
| 164 |
+
"DDIMInverseScheduler",
|
| 165 |
+
"DDIMParallelScheduler",
|
| 166 |
+
"DDIMScheduler",
|
| 167 |
+
"DDPMParallelScheduler",
|
| 168 |
+
"DDPMScheduler",
|
| 169 |
+
"DDPMWuerstchenScheduler",
|
| 170 |
+
"DEISMultistepScheduler",
|
| 171 |
+
"DPMSolverMultistepInverseScheduler",
|
| 172 |
+
"DPMSolverMultistepScheduler",
|
| 173 |
+
"DPMSolverSinglestepScheduler",
|
| 174 |
+
"EDMDPMSolverMultistepScheduler",
|
| 175 |
+
"EDMEulerScheduler",
|
| 176 |
+
"EulerAncestralDiscreteScheduler",
|
| 177 |
+
"EulerDiscreteScheduler",
|
| 178 |
+
"FlowMatchEulerDiscreteScheduler",
|
| 179 |
+
"FlowMatchHeunDiscreteScheduler",
|
| 180 |
+
"HeunDiscreteScheduler",
|
| 181 |
+
"IPNDMScheduler",
|
| 182 |
+
"KarrasVeScheduler",
|
| 183 |
+
"KDPM2AncestralDiscreteScheduler",
|
| 184 |
+
"KDPM2DiscreteScheduler",
|
| 185 |
+
"LCMScheduler",
|
| 186 |
+
"PNDMScheduler",
|
| 187 |
+
"RePaintScheduler",
|
| 188 |
+
"SASolverScheduler",
|
| 189 |
+
"SchedulerMixin",
|
| 190 |
+
"ScoreSdeVeScheduler",
|
| 191 |
+
"TCDScheduler",
|
| 192 |
+
"UnCLIPScheduler",
|
| 193 |
+
"UniPCMultistepScheduler",
|
| 194 |
+
"VQDiffusionScheduler",
|
| 195 |
+
]
|
| 196 |
+
)
|
| 197 |
+
_import_structure["training_utils"] = ["EMAModel"]
|
| 198 |
+
|
| 199 |
+
try:
|
| 200 |
+
if not (is_torch_available() and is_scipy_available()):
|
| 201 |
+
raise OptionalDependencyNotAvailable()
|
| 202 |
+
except OptionalDependencyNotAvailable:
|
| 203 |
+
from .utils import dummy_torch_and_scipy_objects # noqa F403
|
| 204 |
+
|
| 205 |
+
_import_structure["utils.dummy_torch_and_scipy_objects"] = [
|
| 206 |
+
name for name in dir(dummy_torch_and_scipy_objects) if not name.startswith("_")
|
| 207 |
+
]
|
| 208 |
+
|
| 209 |
+
else:
|
| 210 |
+
_import_structure["schedulers"].extend(["LMSDiscreteScheduler"])
|
| 211 |
+
|
| 212 |
+
try:
|
| 213 |
+
if not (is_torch_available() and is_torchsde_available()):
|
| 214 |
+
raise OptionalDependencyNotAvailable()
|
| 215 |
+
except OptionalDependencyNotAvailable:
|
| 216 |
+
from .utils import dummy_torch_and_torchsde_objects # noqa F403
|
| 217 |
+
|
| 218 |
+
_import_structure["utils.dummy_torch_and_torchsde_objects"] = [
|
| 219 |
+
name for name in dir(dummy_torch_and_torchsde_objects) if not name.startswith("_")
|
| 220 |
+
]
|
| 221 |
+
|
| 222 |
+
else:
|
| 223 |
+
_import_structure["schedulers"].extend(["CosineDPMSolverMultistepScheduler", "DPMSolverSDEScheduler"])
|
| 224 |
+
|
| 225 |
+
try:
|
| 226 |
+
if not (is_torch_available() and is_transformers_available()):
|
| 227 |
+
raise OptionalDependencyNotAvailable()
|
| 228 |
+
except OptionalDependencyNotAvailable:
|
| 229 |
+
from .utils import dummy_torch_and_transformers_objects # noqa F403
|
| 230 |
+
|
| 231 |
+
_import_structure["utils.dummy_torch_and_transformers_objects"] = [
|
| 232 |
+
name for name in dir(dummy_torch_and_transformers_objects) if not name.startswith("_")
|
| 233 |
+
]
|
| 234 |
+
|
| 235 |
+
else:
|
| 236 |
+
_import_structure["pipelines"].extend(
|
| 237 |
+
[
|
| 238 |
+
"AltDiffusionImg2ImgPipeline",
|
| 239 |
+
"AltDiffusionPipeline",
|
| 240 |
+
"AmusedImg2ImgPipeline",
|
| 241 |
+
"AmusedInpaintPipeline",
|
| 242 |
+
"AmusedPipeline",
|
| 243 |
+
"AnimateDiffControlNetPipeline",
|
| 244 |
+
"AnimateDiffPAGPipeline",
|
| 245 |
+
"AnimateDiffPipeline",
|
| 246 |
+
"AnimateDiffSDXLPipeline",
|
| 247 |
+
"AnimateDiffSparseControlNetPipeline",
|
| 248 |
+
"AnimateDiffVideoToVideoControlNetPipeline",
|
| 249 |
+
"AnimateDiffVideoToVideoPipeline",
|
| 250 |
+
"AudioLDM2Pipeline",
|
| 251 |
+
"AudioLDM2ProjectionModel",
|
| 252 |
+
"AudioLDM2UNet2DConditionModel",
|
| 253 |
+
"AudioLDMPipeline",
|
| 254 |
+
"AuraFlowPipeline",
|
| 255 |
+
"BlipDiffusionControlNetPipeline",
|
| 256 |
+
"BlipDiffusionPipeline",
|
| 257 |
+
"CLIPImageProjection",
|
| 258 |
+
"CogVideoXPipeline",
|
| 259 |
+
"CogVideoXVideoToVideoPipeline",
|
| 260 |
+
"CycleDiffusionPipeline",
|
| 261 |
+
"FluxControlNetPipeline",
|
| 262 |
+
"FluxImg2ImgPipeline",
|
| 263 |
+
"FluxInpaintPipeline",
|
| 264 |
+
"FluxPipeline",
|
| 265 |
+
"HunyuanDiTControlNetPipeline",
|
| 266 |
+
"HunyuanDiTPAGPipeline",
|
| 267 |
+
"HunyuanDiTPipeline",
|
| 268 |
+
"I2VGenXLPipeline",
|
| 269 |
+
"IFImg2ImgPipeline",
|
| 270 |
+
"IFImg2ImgSuperResolutionPipeline",
|
| 271 |
+
"IFInpaintingPipeline",
|
| 272 |
+
"IFInpaintingSuperResolutionPipeline",
|
| 273 |
+
"IFPipeline",
|
| 274 |
+
"IFSuperResolutionPipeline",
|
| 275 |
+
"ImageTextPipelineOutput",
|
| 276 |
+
"Kandinsky3Img2ImgPipeline",
|
| 277 |
+
"Kandinsky3Pipeline",
|
| 278 |
+
"KandinskyCombinedPipeline",
|
| 279 |
+
"KandinskyImg2ImgCombinedPipeline",
|
| 280 |
+
"KandinskyImg2ImgPipeline",
|
| 281 |
+
"KandinskyInpaintCombinedPipeline",
|
| 282 |
+
"KandinskyInpaintPipeline",
|
| 283 |
+
"KandinskyPipeline",
|
| 284 |
+
"KandinskyPriorPipeline",
|
| 285 |
+
"KandinskyV22CombinedPipeline",
|
| 286 |
+
"KandinskyV22ControlnetImg2ImgPipeline",
|
| 287 |
+
"KandinskyV22ControlnetPipeline",
|
| 288 |
+
"KandinskyV22Img2ImgCombinedPipeline",
|
| 289 |
+
"KandinskyV22Img2ImgPipeline",
|
| 290 |
+
"KandinskyV22InpaintCombinedPipeline",
|
| 291 |
+
"KandinskyV22InpaintPipeline",
|
| 292 |
+
"KandinskyV22Pipeline",
|
| 293 |
+
"KandinskyV22PriorEmb2EmbPipeline",
|
| 294 |
+
"KandinskyV22PriorPipeline",
|
| 295 |
+
"LatentConsistencyModelImg2ImgPipeline",
|
| 296 |
+
"LatentConsistencyModelPipeline",
|
| 297 |
+
"LattePipeline",
|
| 298 |
+
"LDMTextToImagePipeline",
|
| 299 |
+
"LEditsPPPipelineStableDiffusion",
|
| 300 |
+
"LEditsPPPipelineStableDiffusionXL",
|
| 301 |
+
"LuminaText2ImgPipeline",
|
| 302 |
+
"MarigoldDepthPipeline",
|
| 303 |
+
"MarigoldNormalsPipeline",
|
| 304 |
+
"MusicLDMPipeline",
|
| 305 |
+
"PaintByExamplePipeline",
|
| 306 |
+
"PIAPipeline",
|
| 307 |
+
"PixArtAlphaPipeline",
|
| 308 |
+
"PixArtSigmaPAGPipeline",
|
| 309 |
+
"PixArtSigmaPipeline",
|
| 310 |
+
"SemanticStableDiffusionPipeline",
|
| 311 |
+
"ShapEImg2ImgPipeline",
|
| 312 |
+
"ShapEPipeline",
|
| 313 |
+
"StableAudioPipeline",
|
| 314 |
+
"StableAudioProjectionModel",
|
| 315 |
+
"StableCascadeCombinedPipeline",
|
| 316 |
+
"StableCascadeDecoderPipeline",
|
| 317 |
+
"StableCascadePriorPipeline",
|
| 318 |
+
"StableDiffusion3ControlNetInpaintingPipeline",
|
| 319 |
+
"StableDiffusion3ControlNetPipeline",
|
| 320 |
+
"StableDiffusion3Img2ImgPipeline",
|
| 321 |
+
"StableDiffusion3InpaintPipeline",
|
| 322 |
+
"StableDiffusion3PAGPipeline",
|
| 323 |
+
"StableDiffusion3Pipeline",
|
| 324 |
+
"StableDiffusionAdapterPipeline",
|
| 325 |
+
"StableDiffusionAttendAndExcitePipeline",
|
| 326 |
+
"StableDiffusionControlNetImg2ImgPipeline",
|
| 327 |
+
"StableDiffusionControlNetInpaintPipeline",
|
| 328 |
+
"StableDiffusionControlNetPAGPipeline",
|
| 329 |
+
"StableDiffusionControlNetPipeline",
|
| 330 |
+
"StableDiffusionControlNetXSPipeline",
|
| 331 |
+
"StableDiffusionDepth2ImgPipeline",
|
| 332 |
+
"StableDiffusionDiffEditPipeline",
|
| 333 |
+
"StableDiffusionGLIGENPipeline",
|
| 334 |
+
"StableDiffusionGLIGENTextImagePipeline",
|
| 335 |
+
"StableDiffusionImageVariationPipeline",
|
| 336 |
+
"StableDiffusionImg2ImgPipeline",
|
| 337 |
+
"StableDiffusionInpaintPipeline",
|
| 338 |
+
"StableDiffusionInpaintPipelineLegacy",
|
| 339 |
+
"StableDiffusionInstructPix2PixPipeline",
|
| 340 |
+
"StableDiffusionLatentUpscalePipeline",
|
| 341 |
+
"StableDiffusionLDM3DPipeline",
|
| 342 |
+
"StableDiffusionModelEditingPipeline",
|
| 343 |
+
"StableDiffusionPAGPipeline",
|
| 344 |
+
"StableDiffusionPanoramaPipeline",
|
| 345 |
+
"StableDiffusionParadigmsPipeline",
|
| 346 |
+
"StableDiffusionPipeline",
|
| 347 |
+
"StableDiffusionPipelineSafe",
|
| 348 |
+
"StableDiffusionPix2PixZeroPipeline",
|
| 349 |
+
"StableDiffusionSAGPipeline",
|
| 350 |
+
"StableDiffusionUpscalePipeline",
|
| 351 |
+
"StableDiffusionXLAdapterPipeline",
|
| 352 |
+
"StableDiffusionXLControlNetImg2ImgPipeline",
|
| 353 |
+
"StableDiffusionXLControlNetInpaintPipeline",
|
| 354 |
+
"StableDiffusionXLControlNetPAGImg2ImgPipeline",
|
| 355 |
+
"StableDiffusionXLControlNetPAGPipeline",
|
| 356 |
+
"StableDiffusionXLControlNetPipeline",
|
| 357 |
+
"StableDiffusionXLControlNetXSPipeline",
|
| 358 |
+
"StableDiffusionXLImg2ImgPipeline",
|
| 359 |
+
"StableDiffusionXLInpaintPipeline",
|
| 360 |
+
"StableDiffusionXLInstructPix2PixPipeline",
|
| 361 |
+
"StableDiffusionXLPAGImg2ImgPipeline",
|
| 362 |
+
"StableDiffusionXLPAGInpaintPipeline",
|
| 363 |
+
"StableDiffusionXLPAGPipeline",
|
| 364 |
+
"StableDiffusionXLPipeline",
|
| 365 |
+
"StableUnCLIPImg2ImgPipeline",
|
| 366 |
+
"StableUnCLIPPipeline",
|
| 367 |
+
"StableVideoDiffusionPipeline",
|
| 368 |
+
"TextToVideoSDPipeline",
|
| 369 |
+
"TextToVideoZeroPipeline",
|
| 370 |
+
"TextToVideoZeroSDXLPipeline",
|
| 371 |
+
"UnCLIPImageVariationPipeline",
|
| 372 |
+
"UnCLIPPipeline",
|
| 373 |
+
"UniDiffuserModel",
|
| 374 |
+
"UniDiffuserPipeline",
|
| 375 |
+
"UniDiffuserTextDecoder",
|
| 376 |
+
"VersatileDiffusionDualGuidedPipeline",
|
| 377 |
+
"VersatileDiffusionImageVariationPipeline",
|
| 378 |
+
"VersatileDiffusionPipeline",
|
| 379 |
+
"VersatileDiffusionTextToImagePipeline",
|
| 380 |
+
"VideoToVideoSDPipeline",
|
| 381 |
+
"VQDiffusionPipeline",
|
| 382 |
+
"WuerstchenCombinedPipeline",
|
| 383 |
+
"WuerstchenDecoderPipeline",
|
| 384 |
+
"WuerstchenPriorPipeline",
|
| 385 |
+
]
|
| 386 |
+
)
|
| 387 |
+
|
| 388 |
+
try:
|
| 389 |
+
if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()):
|
| 390 |
+
raise OptionalDependencyNotAvailable()
|
| 391 |
+
except OptionalDependencyNotAvailable:
|
| 392 |
+
from .utils import dummy_torch_and_transformers_and_k_diffusion_objects # noqa F403
|
| 393 |
+
|
| 394 |
+
_import_structure["utils.dummy_torch_and_transformers_and_k_diffusion_objects"] = [
|
| 395 |
+
name for name in dir(dummy_torch_and_transformers_and_k_diffusion_objects) if not name.startswith("_")
|
| 396 |
+
]
|
| 397 |
+
|
| 398 |
+
else:
|
| 399 |
+
_import_structure["pipelines"].extend(["StableDiffusionKDiffusionPipeline", "StableDiffusionXLKDiffusionPipeline"])
|
| 400 |
+
|
| 401 |
+
try:
|
| 402 |
+
if not (is_torch_available() and is_transformers_available() and is_sentencepiece_available()):
|
| 403 |
+
raise OptionalDependencyNotAvailable()
|
| 404 |
+
except OptionalDependencyNotAvailable:
|
| 405 |
+
from .utils import dummy_torch_and_transformers_and_sentencepiece_objects # noqa F403
|
| 406 |
+
|
| 407 |
+
_import_structure["utils.dummy_torch_and_transformers_and_sentencepiece_objects"] = [
|
| 408 |
+
name for name in dir(dummy_torch_and_transformers_and_sentencepiece_objects) if not name.startswith("_")
|
| 409 |
+
]
|
| 410 |
+
|
| 411 |
+
else:
|
| 412 |
+
_import_structure["pipelines"].extend(["KolorsImg2ImgPipeline", "KolorsPAGPipeline", "KolorsPipeline"])
|
| 413 |
+
|
| 414 |
+
try:
|
| 415 |
+
if not (is_torch_available() and is_transformers_available() and is_onnx_available()):
|
| 416 |
+
raise OptionalDependencyNotAvailable()
|
| 417 |
+
except OptionalDependencyNotAvailable:
|
| 418 |
+
from .utils import dummy_torch_and_transformers_and_onnx_objects # noqa F403
|
| 419 |
+
|
| 420 |
+
_import_structure["utils.dummy_torch_and_transformers_and_onnx_objects"] = [
|
| 421 |
+
name for name in dir(dummy_torch_and_transformers_and_onnx_objects) if not name.startswith("_")
|
| 422 |
+
]
|
| 423 |
+
|
| 424 |
+
else:
|
| 425 |
+
_import_structure["pipelines"].extend(
|
| 426 |
+
[
|
| 427 |
+
"OnnxStableDiffusionImg2ImgPipeline",
|
| 428 |
+
"OnnxStableDiffusionInpaintPipeline",
|
| 429 |
+
"OnnxStableDiffusionInpaintPipelineLegacy",
|
| 430 |
+
"OnnxStableDiffusionPipeline",
|
| 431 |
+
"OnnxStableDiffusionUpscalePipeline",
|
| 432 |
+
"StableDiffusionOnnxPipeline",
|
| 433 |
+
]
|
| 434 |
+
)
|
| 435 |
+
|
| 436 |
+
try:
|
| 437 |
+
if not (is_torch_available() and is_librosa_available()):
|
| 438 |
+
raise OptionalDependencyNotAvailable()
|
| 439 |
+
except OptionalDependencyNotAvailable:
|
| 440 |
+
from .utils import dummy_torch_and_librosa_objects # noqa F403
|
| 441 |
+
|
| 442 |
+
_import_structure["utils.dummy_torch_and_librosa_objects"] = [
|
| 443 |
+
name for name in dir(dummy_torch_and_librosa_objects) if not name.startswith("_")
|
| 444 |
+
]
|
| 445 |
+
|
| 446 |
+
else:
|
| 447 |
+
_import_structure["pipelines"].extend(["AudioDiffusionPipeline", "Mel"])
|
| 448 |
+
|
| 449 |
+
try:
|
| 450 |
+
if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
|
| 451 |
+
raise OptionalDependencyNotAvailable()
|
| 452 |
+
except OptionalDependencyNotAvailable:
|
| 453 |
+
from .utils import dummy_transformers_and_torch_and_note_seq_objects # noqa F403
|
| 454 |
+
|
| 455 |
+
_import_structure["utils.dummy_transformers_and_torch_and_note_seq_objects"] = [
|
| 456 |
+
name for name in dir(dummy_transformers_and_torch_and_note_seq_objects) if not name.startswith("_")
|
| 457 |
+
]
|
| 458 |
+
|
| 459 |
+
|
| 460 |
+
else:
|
| 461 |
+
_import_structure["pipelines"].extend(["SpectrogramDiffusionPipeline"])
|
| 462 |
+
|
| 463 |
+
try:
|
| 464 |
+
if not is_flax_available():
|
| 465 |
+
raise OptionalDependencyNotAvailable()
|
| 466 |
+
except OptionalDependencyNotAvailable:
|
| 467 |
+
from .utils import dummy_flax_objects # noqa F403
|
| 468 |
+
|
| 469 |
+
_import_structure["utils.dummy_flax_objects"] = [
|
| 470 |
+
name for name in dir(dummy_flax_objects) if not name.startswith("_")
|
| 471 |
+
]
|
| 472 |
+
|
| 473 |
+
|
| 474 |
+
else:
|
| 475 |
+
_import_structure["models.controlnet_flax"] = ["FlaxControlNetModel"]
|
| 476 |
+
_import_structure["models.modeling_flax_utils"] = ["FlaxModelMixin"]
|
| 477 |
+
_import_structure["models.unets.unet_2d_condition_flax"] = ["FlaxUNet2DConditionModel"]
|
| 478 |
+
_import_structure["models.vae_flax"] = ["FlaxAutoencoderKL"]
|
| 479 |
+
_import_structure["pipelines"].extend(["FlaxDiffusionPipeline"])
|
| 480 |
+
_import_structure["schedulers"].extend(
|
| 481 |
+
[
|
| 482 |
+
"FlaxDDIMScheduler",
|
| 483 |
+
"FlaxDDPMScheduler",
|
| 484 |
+
"FlaxDPMSolverMultistepScheduler",
|
| 485 |
+
"FlaxEulerDiscreteScheduler",
|
| 486 |
+
"FlaxKarrasVeScheduler",
|
| 487 |
+
"FlaxLMSDiscreteScheduler",
|
| 488 |
+
"FlaxPNDMScheduler",
|
| 489 |
+
"FlaxSchedulerMixin",
|
| 490 |
+
"FlaxScoreSdeVeScheduler",
|
| 491 |
+
]
|
| 492 |
+
)
|
| 493 |
+
|
| 494 |
+
|
| 495 |
+
try:
|
| 496 |
+
if not (is_flax_available() and is_transformers_available()):
|
| 497 |
+
raise OptionalDependencyNotAvailable()
|
| 498 |
+
except OptionalDependencyNotAvailable:
|
| 499 |
+
from .utils import dummy_flax_and_transformers_objects # noqa F403
|
| 500 |
+
|
| 501 |
+
_import_structure["utils.dummy_flax_and_transformers_objects"] = [
|
| 502 |
+
name for name in dir(dummy_flax_and_transformers_objects) if not name.startswith("_")
|
| 503 |
+
]
|
| 504 |
+
|
| 505 |
+
|
| 506 |
+
else:
|
| 507 |
+
_import_structure["pipelines"].extend(
|
| 508 |
+
[
|
| 509 |
+
"FlaxStableDiffusionControlNetPipeline",
|
| 510 |
+
"FlaxStableDiffusionImg2ImgPipeline",
|
| 511 |
+
"FlaxStableDiffusionInpaintPipeline",
|
| 512 |
+
"FlaxStableDiffusionPipeline",
|
| 513 |
+
"FlaxStableDiffusionXLPipeline",
|
| 514 |
+
]
|
| 515 |
+
)
|
| 516 |
+
|
| 517 |
+
try:
|
| 518 |
+
if not (is_note_seq_available()):
|
| 519 |
+
raise OptionalDependencyNotAvailable()
|
| 520 |
+
except OptionalDependencyNotAvailable:
|
| 521 |
+
from .utils import dummy_note_seq_objects # noqa F403
|
| 522 |
+
|
| 523 |
+
_import_structure["utils.dummy_note_seq_objects"] = [
|
| 524 |
+
name for name in dir(dummy_note_seq_objects) if not name.startswith("_")
|
| 525 |
+
]
|
| 526 |
+
|
| 527 |
+
|
| 528 |
+
else:
|
| 529 |
+
_import_structure["pipelines"].extend(["MidiProcessor"])
|
| 530 |
+
|
| 531 |
+
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
|
| 532 |
+
from .configuration_utils import ConfigMixin
|
| 533 |
+
|
| 534 |
+
try:
|
| 535 |
+
if not is_onnx_available():
|
| 536 |
+
raise OptionalDependencyNotAvailable()
|
| 537 |
+
except OptionalDependencyNotAvailable:
|
| 538 |
+
from .utils.dummy_onnx_objects import * # noqa F403
|
| 539 |
+
else:
|
| 540 |
+
from .pipelines import OnnxRuntimeModel
|
| 541 |
+
|
| 542 |
+
try:
|
| 543 |
+
if not is_torch_available():
|
| 544 |
+
raise OptionalDependencyNotAvailable()
|
| 545 |
+
except OptionalDependencyNotAvailable:
|
| 546 |
+
from .utils.dummy_pt_objects import * # noqa F403
|
| 547 |
+
else:
|
| 548 |
+
from .models import (
|
| 549 |
+
AsymmetricAutoencoderKL,
|
| 550 |
+
AuraFlowTransformer2DModel,
|
| 551 |
+
AutoencoderKL,
|
| 552 |
+
AutoencoderKLCogVideoX,
|
| 553 |
+
AutoencoderKLTemporalDecoder,
|
| 554 |
+
AutoencoderOobleck,
|
| 555 |
+
AutoencoderTiny,
|
| 556 |
+
CogVideoXTransformer3DModel,
|
| 557 |
+
ConsistencyDecoderVAE,
|
| 558 |
+
ControlNetModel,
|
| 559 |
+
ControlNetXSAdapter,
|
| 560 |
+
DiTTransformer2DModel,
|
| 561 |
+
FluxControlNetModel,
|
| 562 |
+
FluxMultiControlNetModel,
|
| 563 |
+
FluxTransformer2DModel,
|
| 564 |
+
HunyuanDiT2DControlNetModel,
|
| 565 |
+
HunyuanDiT2DModel,
|
| 566 |
+
HunyuanDiT2DMultiControlNetModel,
|
| 567 |
+
I2VGenXLUNet,
|
| 568 |
+
Kandinsky3UNet,
|
| 569 |
+
LatteTransformer3DModel,
|
| 570 |
+
LuminaNextDiT2DModel,
|
| 571 |
+
ModelMixin,
|
| 572 |
+
MotionAdapter,
|
| 573 |
+
MultiAdapter,
|
| 574 |
+
PixArtTransformer2DModel,
|
| 575 |
+
PriorTransformer,
|
| 576 |
+
SD3ControlNetModel,
|
| 577 |
+
SD3MultiControlNetModel,
|
| 578 |
+
SD3Transformer2DModel,
|
| 579 |
+
SparseControlNetModel,
|
| 580 |
+
StableAudioDiTModel,
|
| 581 |
+
T2IAdapter,
|
| 582 |
+
T5FilmDecoder,
|
| 583 |
+
Transformer2DModel,
|
| 584 |
+
UNet1DModel,
|
| 585 |
+
UNet2DConditionModel,
|
| 586 |
+
UNet2DModel,
|
| 587 |
+
UNet3DConditionModel,
|
| 588 |
+
UNetControlNetXSModel,
|
| 589 |
+
UNetMotionModel,
|
| 590 |
+
UNetSpatioTemporalConditionModel,
|
| 591 |
+
UVit2DModel,
|
| 592 |
+
VQModel,
|
| 593 |
+
)
|
| 594 |
+
from .optimization import (
|
| 595 |
+
get_constant_schedule,
|
| 596 |
+
get_constant_schedule_with_warmup,
|
| 597 |
+
get_cosine_schedule_with_warmup,
|
| 598 |
+
get_cosine_with_hard_restarts_schedule_with_warmup,
|
| 599 |
+
get_linear_schedule_with_warmup,
|
| 600 |
+
get_polynomial_decay_schedule_with_warmup,
|
| 601 |
+
get_scheduler,
|
| 602 |
+
)
|
| 603 |
+
from .pipelines import (
|
| 604 |
+
AudioPipelineOutput,
|
| 605 |
+
AutoPipelineForImage2Image,
|
| 606 |
+
AutoPipelineForInpainting,
|
| 607 |
+
AutoPipelineForText2Image,
|
| 608 |
+
BlipDiffusionControlNetPipeline,
|
| 609 |
+
BlipDiffusionPipeline,
|
| 610 |
+
CLIPImageProjection,
|
| 611 |
+
ConsistencyModelPipeline,
|
| 612 |
+
DanceDiffusionPipeline,
|
| 613 |
+
DDIMPipeline,
|
| 614 |
+
DDPMPipeline,
|
| 615 |
+
DiffusionPipeline,
|
| 616 |
+
DiTPipeline,
|
| 617 |
+
ImagePipelineOutput,
|
| 618 |
+
KarrasVePipeline,
|
| 619 |
+
LDMPipeline,
|
| 620 |
+
LDMSuperResolutionPipeline,
|
| 621 |
+
PNDMPipeline,
|
| 622 |
+
RePaintPipeline,
|
| 623 |
+
ScoreSdeVePipeline,
|
| 624 |
+
StableDiffusionMixin,
|
| 625 |
+
)
|
| 626 |
+
from .schedulers import (
|
| 627 |
+
AmusedScheduler,
|
| 628 |
+
CMStochasticIterativeScheduler,
|
| 629 |
+
CogVideoXDDIMScheduler,
|
| 630 |
+
CogVideoXDPMScheduler,
|
| 631 |
+
DDIMInverseScheduler,
|
| 632 |
+
DDIMParallelScheduler,
|
| 633 |
+
DDIMScheduler,
|
| 634 |
+
DDPMParallelScheduler,
|
| 635 |
+
DDPMScheduler,
|
| 636 |
+
DDPMWuerstchenScheduler,
|
| 637 |
+
DEISMultistepScheduler,
|
| 638 |
+
DPMSolverMultistepInverseScheduler,
|
| 639 |
+
DPMSolverMultistepScheduler,
|
| 640 |
+
DPMSolverSinglestepScheduler,
|
| 641 |
+
EDMDPMSolverMultistepScheduler,
|
| 642 |
+
EDMEulerScheduler,
|
| 643 |
+
EulerAncestralDiscreteScheduler,
|
| 644 |
+
EulerDiscreteScheduler,
|
| 645 |
+
FlowMatchEulerDiscreteScheduler,
|
| 646 |
+
FlowMatchHeunDiscreteScheduler,
|
| 647 |
+
HeunDiscreteScheduler,
|
| 648 |
+
IPNDMScheduler,
|
| 649 |
+
KarrasVeScheduler,
|
| 650 |
+
KDPM2AncestralDiscreteScheduler,
|
| 651 |
+
KDPM2DiscreteScheduler,
|
| 652 |
+
LCMScheduler,
|
| 653 |
+
PNDMScheduler,
|
| 654 |
+
RePaintScheduler,
|
| 655 |
+
SASolverScheduler,
|
| 656 |
+
SchedulerMixin,
|
| 657 |
+
ScoreSdeVeScheduler,
|
| 658 |
+
TCDScheduler,
|
| 659 |
+
UnCLIPScheduler,
|
| 660 |
+
UniPCMultistepScheduler,
|
| 661 |
+
VQDiffusionScheduler,
|
| 662 |
+
)
|
| 663 |
+
from .training_utils import EMAModel
|
| 664 |
+
|
| 665 |
+
try:
|
| 666 |
+
if not (is_torch_available() and is_scipy_available()):
|
| 667 |
+
raise OptionalDependencyNotAvailable()
|
| 668 |
+
except OptionalDependencyNotAvailable:
|
| 669 |
+
from .utils.dummy_torch_and_scipy_objects import * # noqa F403
|
| 670 |
+
else:
|
| 671 |
+
from .schedulers import LMSDiscreteScheduler
|
| 672 |
+
|
| 673 |
+
try:
|
| 674 |
+
if not (is_torch_available() and is_torchsde_available()):
|
| 675 |
+
raise OptionalDependencyNotAvailable()
|
| 676 |
+
except OptionalDependencyNotAvailable:
|
| 677 |
+
from .utils.dummy_torch_and_torchsde_objects import * # noqa F403
|
| 678 |
+
else:
|
| 679 |
+
from .schedulers import CosineDPMSolverMultistepScheduler, DPMSolverSDEScheduler
|
| 680 |
+
|
| 681 |
+
try:
|
| 682 |
+
if not (is_torch_available() and is_transformers_available()):
|
| 683 |
+
raise OptionalDependencyNotAvailable()
|
| 684 |
+
except OptionalDependencyNotAvailable:
|
| 685 |
+
from .utils.dummy_torch_and_transformers_objects import * # noqa F403
|
| 686 |
+
else:
|
| 687 |
+
from .pipelines import (
|
| 688 |
+
AltDiffusionImg2ImgPipeline,
|
| 689 |
+
AltDiffusionPipeline,
|
| 690 |
+
AmusedImg2ImgPipeline,
|
| 691 |
+
AmusedInpaintPipeline,
|
| 692 |
+
AmusedPipeline,
|
| 693 |
+
AnimateDiffControlNetPipeline,
|
| 694 |
+
AnimateDiffPAGPipeline,
|
| 695 |
+
AnimateDiffPipeline,
|
| 696 |
+
AnimateDiffSDXLPipeline,
|
| 697 |
+
AnimateDiffSparseControlNetPipeline,
|
| 698 |
+
AnimateDiffVideoToVideoControlNetPipeline,
|
| 699 |
+
AnimateDiffVideoToVideoPipeline,
|
| 700 |
+
AudioLDM2Pipeline,
|
| 701 |
+
AudioLDM2ProjectionModel,
|
| 702 |
+
AudioLDM2UNet2DConditionModel,
|
| 703 |
+
AudioLDMPipeline,
|
| 704 |
+
AuraFlowPipeline,
|
| 705 |
+
CLIPImageProjection,
|
| 706 |
+
CogVideoXPipeline,
|
| 707 |
+
CogVideoXVideoToVideoPipeline,
|
| 708 |
+
CycleDiffusionPipeline,
|
| 709 |
+
FluxControlNetPipeline,
|
| 710 |
+
FluxImg2ImgPipeline,
|
| 711 |
+
FluxInpaintPipeline,
|
| 712 |
+
FluxPipeline,
|
| 713 |
+
HunyuanDiTControlNetPipeline,
|
| 714 |
+
HunyuanDiTPAGPipeline,
|
| 715 |
+
HunyuanDiTPipeline,
|
| 716 |
+
I2VGenXLPipeline,
|
| 717 |
+
IFImg2ImgPipeline,
|
| 718 |
+
IFImg2ImgSuperResolutionPipeline,
|
| 719 |
+
IFInpaintingPipeline,
|
| 720 |
+
IFInpaintingSuperResolutionPipeline,
|
| 721 |
+
IFPipeline,
|
| 722 |
+
IFSuperResolutionPipeline,
|
| 723 |
+
ImageTextPipelineOutput,
|
| 724 |
+
Kandinsky3Img2ImgPipeline,
|
| 725 |
+
Kandinsky3Pipeline,
|
| 726 |
+
KandinskyCombinedPipeline,
|
| 727 |
+
KandinskyImg2ImgCombinedPipeline,
|
| 728 |
+
KandinskyImg2ImgPipeline,
|
| 729 |
+
KandinskyInpaintCombinedPipeline,
|
| 730 |
+
KandinskyInpaintPipeline,
|
| 731 |
+
KandinskyPipeline,
|
| 732 |
+
KandinskyPriorPipeline,
|
| 733 |
+
KandinskyV22CombinedPipeline,
|
| 734 |
+
KandinskyV22ControlnetImg2ImgPipeline,
|
| 735 |
+
KandinskyV22ControlnetPipeline,
|
| 736 |
+
KandinskyV22Img2ImgCombinedPipeline,
|
| 737 |
+
KandinskyV22Img2ImgPipeline,
|
| 738 |
+
KandinskyV22InpaintCombinedPipeline,
|
| 739 |
+
KandinskyV22InpaintPipeline,
|
| 740 |
+
KandinskyV22Pipeline,
|
| 741 |
+
KandinskyV22PriorEmb2EmbPipeline,
|
| 742 |
+
KandinskyV22PriorPipeline,
|
| 743 |
+
LatentConsistencyModelImg2ImgPipeline,
|
| 744 |
+
LatentConsistencyModelPipeline,
|
| 745 |
+
LattePipeline,
|
| 746 |
+
LDMTextToImagePipeline,
|
| 747 |
+
LEditsPPPipelineStableDiffusion,
|
| 748 |
+
LEditsPPPipelineStableDiffusionXL,
|
| 749 |
+
LuminaText2ImgPipeline,
|
| 750 |
+
MarigoldDepthPipeline,
|
| 751 |
+
MarigoldNormalsPipeline,
|
| 752 |
+
MusicLDMPipeline,
|
| 753 |
+
PaintByExamplePipeline,
|
| 754 |
+
PIAPipeline,
|
| 755 |
+
PixArtAlphaPipeline,
|
| 756 |
+
PixArtSigmaPAGPipeline,
|
| 757 |
+
PixArtSigmaPipeline,
|
| 758 |
+
SemanticStableDiffusionPipeline,
|
| 759 |
+
ShapEImg2ImgPipeline,
|
| 760 |
+
ShapEPipeline,
|
| 761 |
+
StableAudioPipeline,
|
| 762 |
+
StableAudioProjectionModel,
|
| 763 |
+
StableCascadeCombinedPipeline,
|
| 764 |
+
StableCascadeDecoderPipeline,
|
| 765 |
+
StableCascadePriorPipeline,
|
| 766 |
+
StableDiffusion3ControlNetPipeline,
|
| 767 |
+
StableDiffusion3Img2ImgPipeline,
|
| 768 |
+
StableDiffusion3InpaintPipeline,
|
| 769 |
+
StableDiffusion3PAGPipeline,
|
| 770 |
+
StableDiffusion3Pipeline,
|
| 771 |
+
StableDiffusionAdapterPipeline,
|
| 772 |
+
StableDiffusionAttendAndExcitePipeline,
|
| 773 |
+
StableDiffusionControlNetImg2ImgPipeline,
|
| 774 |
+
StableDiffusionControlNetInpaintPipeline,
|
| 775 |
+
StableDiffusionControlNetPAGPipeline,
|
| 776 |
+
StableDiffusionControlNetPipeline,
|
| 777 |
+
StableDiffusionControlNetXSPipeline,
|
| 778 |
+
StableDiffusionDepth2ImgPipeline,
|
| 779 |
+
StableDiffusionDiffEditPipeline,
|
| 780 |
+
StableDiffusionGLIGENPipeline,
|
| 781 |
+
StableDiffusionGLIGENTextImagePipeline,
|
| 782 |
+
StableDiffusionImageVariationPipeline,
|
| 783 |
+
StableDiffusionImg2ImgPipeline,
|
| 784 |
+
StableDiffusionInpaintPipeline,
|
| 785 |
+
StableDiffusionInpaintPipelineLegacy,
|
| 786 |
+
StableDiffusionInstructPix2PixPipeline,
|
| 787 |
+
StableDiffusionLatentUpscalePipeline,
|
| 788 |
+
StableDiffusionLDM3DPipeline,
|
| 789 |
+
StableDiffusionModelEditingPipeline,
|
| 790 |
+
StableDiffusionPAGPipeline,
|
| 791 |
+
StableDiffusionPanoramaPipeline,
|
| 792 |
+
StableDiffusionParadigmsPipeline,
|
| 793 |
+
StableDiffusionPipeline,
|
| 794 |
+
StableDiffusionPipelineSafe,
|
| 795 |
+
StableDiffusionPix2PixZeroPipeline,
|
| 796 |
+
StableDiffusionSAGPipeline,
|
| 797 |
+
StableDiffusionUpscalePipeline,
|
| 798 |
+
StableDiffusionXLAdapterPipeline,
|
| 799 |
+
StableDiffusionXLControlNetImg2ImgPipeline,
|
| 800 |
+
StableDiffusionXLControlNetInpaintPipeline,
|
| 801 |
+
StableDiffusionXLControlNetPAGImg2ImgPipeline,
|
| 802 |
+
StableDiffusionXLControlNetPAGPipeline,
|
| 803 |
+
StableDiffusionXLControlNetPipeline,
|
| 804 |
+
StableDiffusionXLControlNetXSPipeline,
|
| 805 |
+
StableDiffusionXLImg2ImgPipeline,
|
| 806 |
+
StableDiffusionXLInpaintPipeline,
|
| 807 |
+
StableDiffusionXLInstructPix2PixPipeline,
|
| 808 |
+
StableDiffusionXLPAGImg2ImgPipeline,
|
| 809 |
+
StableDiffusionXLPAGInpaintPipeline,
|
| 810 |
+
StableDiffusionXLPAGPipeline,
|
| 811 |
+
StableDiffusionXLPipeline,
|
| 812 |
+
StableUnCLIPImg2ImgPipeline,
|
| 813 |
+
StableUnCLIPPipeline,
|
| 814 |
+
StableVideoDiffusionPipeline,
|
| 815 |
+
TextToVideoSDPipeline,
|
| 816 |
+
TextToVideoZeroPipeline,
|
| 817 |
+
TextToVideoZeroSDXLPipeline,
|
| 818 |
+
UnCLIPImageVariationPipeline,
|
| 819 |
+
UnCLIPPipeline,
|
| 820 |
+
UniDiffuserModel,
|
| 821 |
+
UniDiffuserPipeline,
|
| 822 |
+
UniDiffuserTextDecoder,
|
| 823 |
+
VersatileDiffusionDualGuidedPipeline,
|
| 824 |
+
VersatileDiffusionImageVariationPipeline,
|
| 825 |
+
VersatileDiffusionPipeline,
|
| 826 |
+
VersatileDiffusionTextToImagePipeline,
|
| 827 |
+
VideoToVideoSDPipeline,
|
| 828 |
+
VQDiffusionPipeline,
|
| 829 |
+
WuerstchenCombinedPipeline,
|
| 830 |
+
WuerstchenDecoderPipeline,
|
| 831 |
+
WuerstchenPriorPipeline,
|
| 832 |
+
)
|
| 833 |
+
|
| 834 |
+
try:
|
| 835 |
+
if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()):
|
| 836 |
+
raise OptionalDependencyNotAvailable()
|
| 837 |
+
except OptionalDependencyNotAvailable:
|
| 838 |
+
from .utils.dummy_torch_and_transformers_and_k_diffusion_objects import * # noqa F403
|
| 839 |
+
else:
|
| 840 |
+
from .pipelines import StableDiffusionKDiffusionPipeline, StableDiffusionXLKDiffusionPipeline
|
| 841 |
+
|
| 842 |
+
try:
|
| 843 |
+
if not (is_torch_available() and is_transformers_available() and is_sentencepiece_available()):
|
| 844 |
+
raise OptionalDependencyNotAvailable()
|
| 845 |
+
except OptionalDependencyNotAvailable:
|
| 846 |
+
from .utils.dummy_torch_and_transformers_and_sentencepiece_objects import * # noqa F403
|
| 847 |
+
else:
|
| 848 |
+
from .pipelines import KolorsImg2ImgPipeline, KolorsPAGPipeline, KolorsPipeline
|
| 849 |
+
try:
|
| 850 |
+
if not (is_torch_available() and is_transformers_available() and is_onnx_available()):
|
| 851 |
+
raise OptionalDependencyNotAvailable()
|
| 852 |
+
except OptionalDependencyNotAvailable:
|
| 853 |
+
from .utils.dummy_torch_and_transformers_and_onnx_objects import * # noqa F403
|
| 854 |
+
else:
|
| 855 |
+
from .pipelines import (
|
| 856 |
+
OnnxStableDiffusionImg2ImgPipeline,
|
| 857 |
+
OnnxStableDiffusionInpaintPipeline,
|
| 858 |
+
OnnxStableDiffusionInpaintPipelineLegacy,
|
| 859 |
+
OnnxStableDiffusionPipeline,
|
| 860 |
+
OnnxStableDiffusionUpscalePipeline,
|
| 861 |
+
StableDiffusionOnnxPipeline,
|
| 862 |
+
)
|
| 863 |
+
|
| 864 |
+
try:
|
| 865 |
+
if not (is_torch_available() and is_librosa_available()):
|
| 866 |
+
raise OptionalDependencyNotAvailable()
|
| 867 |
+
except OptionalDependencyNotAvailable:
|
| 868 |
+
from .utils.dummy_torch_and_librosa_objects import * # noqa F403
|
| 869 |
+
else:
|
| 870 |
+
from .pipelines import AudioDiffusionPipeline, Mel
|
| 871 |
+
|
| 872 |
+
try:
|
| 873 |
+
if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
|
| 874 |
+
raise OptionalDependencyNotAvailable()
|
| 875 |
+
except OptionalDependencyNotAvailable:
|
| 876 |
+
from .utils.dummy_transformers_and_torch_and_note_seq_objects import * # noqa F403
|
| 877 |
+
else:
|
| 878 |
+
from .pipelines import SpectrogramDiffusionPipeline
|
| 879 |
+
|
| 880 |
+
try:
|
| 881 |
+
if not is_flax_available():
|
| 882 |
+
raise OptionalDependencyNotAvailable()
|
| 883 |
+
except OptionalDependencyNotAvailable:
|
| 884 |
+
from .utils.dummy_flax_objects import * # noqa F403
|
| 885 |
+
else:
|
| 886 |
+
from .models.controlnet_flax import FlaxControlNetModel
|
| 887 |
+
from .models.modeling_flax_utils import FlaxModelMixin
|
| 888 |
+
from .models.unets.unet_2d_condition_flax import FlaxUNet2DConditionModel
|
| 889 |
+
from .models.vae_flax import FlaxAutoencoderKL
|
| 890 |
+
from .pipelines import FlaxDiffusionPipeline
|
| 891 |
+
from .schedulers import (
|
| 892 |
+
FlaxDDIMScheduler,
|
| 893 |
+
FlaxDDPMScheduler,
|
| 894 |
+
FlaxDPMSolverMultistepScheduler,
|
| 895 |
+
FlaxEulerDiscreteScheduler,
|
| 896 |
+
FlaxKarrasVeScheduler,
|
| 897 |
+
FlaxLMSDiscreteScheduler,
|
| 898 |
+
FlaxPNDMScheduler,
|
| 899 |
+
FlaxSchedulerMixin,
|
| 900 |
+
FlaxScoreSdeVeScheduler,
|
| 901 |
+
)
|
| 902 |
+
|
| 903 |
+
try:
|
| 904 |
+
if not (is_flax_available() and is_transformers_available()):
|
| 905 |
+
raise OptionalDependencyNotAvailable()
|
| 906 |
+
except OptionalDependencyNotAvailable:
|
| 907 |
+
from .utils.dummy_flax_and_transformers_objects import * # noqa F403
|
| 908 |
+
else:
|
| 909 |
+
from .pipelines import (
|
| 910 |
+
FlaxStableDiffusionControlNetPipeline,
|
| 911 |
+
FlaxStableDiffusionImg2ImgPipeline,
|
| 912 |
+
FlaxStableDiffusionInpaintPipeline,
|
| 913 |
+
FlaxStableDiffusionPipeline,
|
| 914 |
+
FlaxStableDiffusionXLPipeline,
|
| 915 |
+
)
|
| 916 |
+
|
| 917 |
+
try:
|
| 918 |
+
if not (is_note_seq_available()):
|
| 919 |
+
raise OptionalDependencyNotAvailable()
|
| 920 |
+
except OptionalDependencyNotAvailable:
|
| 921 |
+
from .utils.dummy_note_seq_objects import * # noqa F403
|
| 922 |
+
else:
|
| 923 |
+
from .pipelines import MidiProcessor
|
| 924 |
+
|
| 925 |
+
else:
|
| 926 |
+
import sys
|
| 927 |
+
|
| 928 |
+
sys.modules[__name__] = _LazyModule(
|
| 929 |
+
__name__,
|
| 930 |
+
globals()["__file__"],
|
| 931 |
+
_import_structure,
|
| 932 |
+
module_spec=__spec__,
|
| 933 |
+
extra_objects={"__version__": __version__},
|
| 934 |
+
)
|