Oysiyl Claude Sonnet 4.5 commited on
Commit
61084b9
·
1 Parent(s): 08c63d3

Fix animation compatibility with AOTI compilation and inference mode

Browse files

- Disable animation during AOTI compilation and warmup (4 places)
- Change torch.inference_mode() to torch.no_grad() for animation compatibility
- Fixes "Inference tensors do not track version counter" error
- Fixes "CapturedCallException" during AOTI compilation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -438,6 +438,7 @@ def compile_models_with_aoti():
438
  module_drawer="Square",
439
  seed=TEST_SEED,
440
  enable_upscale=False,
 
441
  controlnet_strength_first=1.5,
442
  controlnet_strength_final=0.9,
443
  )
@@ -474,6 +475,7 @@ def compile_models_with_aoti():
474
  module_drawer="Square",
475
  seed=TEST_SEED,
476
  enable_upscale=False,
 
477
  controlnet_strength_first=1.5,
478
  controlnet_strength_final=0.9,
479
  freeu_b1=1.3,
@@ -528,6 +530,7 @@ def compile_models_with_aoti():
528
  module_drawer="Square",
529
  seed=TEST_SEED,
530
  enable_upscale=False,
 
531
  controlnet_strength_first=1.5,
532
  controlnet_strength_final=0.9,
533
  )
@@ -549,6 +552,7 @@ def compile_models_with_aoti():
549
  module_drawer="Square",
550
  seed=TEST_SEED,
551
  enable_upscale=False,
 
552
  controlnet_strength_first=1.5,
553
  controlnet_strength_final=0.9,
554
  freeu_b1=1.3,
@@ -622,7 +626,7 @@ def generate_qr_code_unified(
622
  # Use custom seed or random
623
  actual_seed = seed if use_custom_seed else random.randint(1, 2**32 - 1)
624
 
625
- with torch.inference_mode():
626
  if pipeline == "standard":
627
  yield from _pipeline_standard(
628
  prompt=prompt,
 
438
  module_drawer="Square",
439
  seed=TEST_SEED,
440
  enable_upscale=False,
441
+ enable_animation=False,
442
  controlnet_strength_first=1.5,
443
  controlnet_strength_final=0.9,
444
  )
 
475
  module_drawer="Square",
476
  seed=TEST_SEED,
477
  enable_upscale=False,
478
+ enable_animation=False,
479
  controlnet_strength_first=1.5,
480
  controlnet_strength_final=0.9,
481
  freeu_b1=1.3,
 
530
  module_drawer="Square",
531
  seed=TEST_SEED,
532
  enable_upscale=False,
533
+ enable_animation=False,
534
  controlnet_strength_first=1.5,
535
  controlnet_strength_final=0.9,
536
  )
 
552
  module_drawer="Square",
553
  seed=TEST_SEED,
554
  enable_upscale=False,
555
+ enable_animation=False,
556
  controlnet_strength_first=1.5,
557
  controlnet_strength_final=0.9,
558
  freeu_b1=1.3,
 
626
  # Use custom seed or random
627
  actual_seed = seed if use_custom_seed else random.randint(1, 2**32 - 1)
628
 
629
+ with torch.no_grad():
630
  if pipeline == "standard":
631
  yield from _pipeline_standard(
632
  prompt=prompt,