Skip to content

Commit e1df951

Browse files
authored
Update rerender_a_video.py
1 parent c28db0a commit e1df951

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/community/rerender_a_video.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,17 @@
3030
from diffusers.pipelines.controlnet.pipeline_controlnet_img2img import StableDiffusionControlNetImg2ImgPipeline
3131
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
3232
from diffusers.schedulers import KarrasDiffusionSchedulers
33-
from diffusers.utils import BaseOutput, deprecate, logging
33+
from diffusers.utils import is_torch_xla_available, BaseOutput, deprecate, logging
3434
from diffusers.utils.torch_utils import is_compiled_module, randn_tensor
3535

36+
if is_torch_xla_available():
37+
import torch_xla.core.xla_model as xm
3638

37-
logger = logging.get_logger(__name__) # pylint: disable=invalid-name
39+
XLA_AVAILABLE = True
40+
else:
41+
XLA_AVAILABLE = False
3842

43+
logger = logging.get_logger(__name__) # pylint: disable=invalid-name
3944

4045
def coords_grid(b, h, w, homogeneous=False, device=None):
4146
y, x = torch.meshgrid(torch.arange(h), torch.arange(w)) # [H, W]

0 commit comments

Comments
 (0)