File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/diffusers/pipelines/sana Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 31
31
USE_PEFT_BACKEND ,
32
32
is_bs4_available ,
33
33
is_ftfy_available ,
34
+ is_torch_xla_available ,
34
35
logging ,
35
36
replace_example_docstring ,
36
37
scale_lora_layers ,
46
47
from .pipeline_output import SanaPipelineOutput
47
48
48
49
50
+ if is_torch_xla_available ():
51
+ import torch_xla .core .xla_model as xm
52
+
53
+ XLA_AVAILABLE = True
54
+ else :
55
+ XLA_AVAILABLE = False
56
+
49
57
logger = logging .get_logger (__name__ ) # pylint: disable=invalid-name
50
58
51
59
if is_bs4_available ():
@@ -864,6 +872,9 @@ def __call__(
864
872
if i == len (timesteps ) - 1 or ((i + 1 ) > num_warmup_steps and (i + 1 ) % self .scheduler .order == 0 ):
865
873
progress_bar .update ()
866
874
875
+ if XLA_AVAILABLE :
876
+ xm .mark_step ()
877
+
867
878
if output_type == "latent" :
868
879
image = latents
869
880
else :
You can’t perform that action at this time.
0 commit comments