|
15 | 15 | from ...models import AutoencoderKL, UNet2DConditionModel |
16 | 16 | from ...models.lora import adjust_lora_scale_text_encoder |
17 | 17 | from ...schedulers import KarrasDiffusionSchedulers |
18 | | -from ...utils import USE_PEFT_BACKEND, is_torch_xla_available, BaseOutput, logging, scale_lora_layers, unscale_lora_layers |
| 18 | +from ...utils import ( |
| 19 | + USE_PEFT_BACKEND, |
| 20 | + is_torch_xla_available, |
| 21 | + BaseOutput, |
| 22 | + logging, |
| 23 | + scale_lora_layers, |
| 24 | + unscale_lora_layers, |
| 25 | +) |
19 | 26 | from ...utils.torch_utils import randn_tensor |
20 | 27 | from ..pipeline_utils import DiffusionPipeline, StableDiffusionMixin |
21 | 28 | from ..stable_diffusion import StableDiffusionSafetyChecker |
@@ -288,7 +295,11 @@ def create_motion_field_and_warp_latents(motion_field_strength_x, motion_field_s |
288 | 295 |
|
289 | 296 |
|
290 | 297 | class TextToVideoZeroPipeline( |
291 | | - DiffusionPipeline, StableDiffusionMixin, TextualInversionLoaderMixin, StableDiffusionLoraLoaderMixin, FromSingleFileMixin |
| 298 | + DiffusionPipeline, |
| 299 | + StableDiffusionMixin, |
| 300 | + TextualInversionLoaderMixin, |
| 301 | + StableDiffusionLoraLoaderMixin, |
| 302 | + FromSingleFileMixin, |
292 | 303 | ): |
293 | 304 | r""" |
294 | 305 | Pipeline for zero-shot text-to-video generation using Stable Diffusion. |
@@ -446,10 +457,10 @@ def backward_loop( |
446 | 457 | if callback is not None and i % callback_steps == 0: |
447 | 458 | step_idx = i // getattr(self.scheduler, "order", 1) |
448 | 459 | callback(step_idx, t, latents) |
449 | | - |
| 460 | + |
450 | 461 | if XLA_AVAILABLE: |
451 | 462 | xm.mark_step() |
452 | | - |
| 463 | + |
453 | 464 | return latents.clone().detach() |
454 | 465 |
|
455 | 466 | # Copied from diffusers.pipelines.stable_diffusion_k_diffusion.pipeline_stable_diffusion_k_diffusion.StableDiffusionKDiffusionPipeline.check_inputs |
|
0 commit comments