dagloop5 commited on
Commit
6c0737c
·
verified ·
1 Parent(s): fb49839

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -11
app.py CHANGED
@@ -424,6 +424,15 @@ def generate_video(
424
  except Exception as e:
425
  # Defensive: if the descriptor isn't present, continue quietly
426
  print(f"[LoRA] could not set strength: {e}")
 
 
 
 
 
 
 
 
 
427
 
428
  log_memory("before pipeline call")
429
 
@@ -478,7 +487,7 @@ with gr.Blocks(title="LTX-2.3 Heretic Distilled") as demo:
478
  lines=3,
479
  placeholder="Describe the motion and animation you want...",
480
  )
481
- duration = gr.Slider(label="Duration (seconds)", minimum=1.0, maximum=10.0, value=3.0, step=0.1)
482
 
483
 
484
  generate_btn = gr.Button("Generate Video", variant="primary", size="lg")
@@ -492,15 +501,16 @@ with gr.Blocks(title="LTX-2.3 Heretic Distilled") as demo:
492
  with gr.Row():
493
  enhance_prompt = gr.Checkbox(label="Enhance Prompt", value=False)
494
  high_res = gr.Checkbox(label="High Resolution", value=True)
495
- # >>> ADD this line inside the Advanced Settings (e.g., after randomize_seed)
496
- lora_strength = gr.Slider(
497
- label="LoRA Strength",
498
- info="Scale for the LoRA weights (0.0 = off). Set near 1.0 for full effect.",
499
- minimum=0.0,
500
- maximum=1.5,
501
- value=1.0,
502
- step=0.01,
503
- )
 
504
 
505
  with gr.Column():
506
  output_video = gr.Video(label="Generated Video", autoplay=False)
@@ -523,7 +533,7 @@ with gr.Blocks(title="LTX-2.3 Heretic Distilled") as demo:
523
  True,
524
  1024,
525
  1024,
526
- 1,
527
  ],
528
  ],
529
  inputs=[
 
424
  except Exception as e:
425
  # Defensive: if the descriptor isn't present, continue quietly
426
  print(f"[LoRA] could not set strength: {e}")
427
+
428
+ # >>> FORCE transformer rebuild so LoRA strength updates
429
+ try:
430
+ # Clear cached transformer so new LoRA strength is applied
431
+ if hasattr(pipeline.model_ledger, "_transformer"):
432
+ pipeline.model_ledger._transformer = None
433
+ print("[LoRA] transformer cache cleared")
434
+ except Exception as e:
435
+ print(f"[LoRA] transformer reset failed: {e}")
436
 
437
  log_memory("before pipeline call")
438
 
 
487
  lines=3,
488
  placeholder="Describe the motion and animation you want...",
489
  )
490
+ duration = gr.Slider(label="Duration (seconds)", minimum=1.0, maximum=30.0, value=10.0, step=0.1)
491
 
492
 
493
  generate_btn = gr.Button("Generate Video", variant="primary", size="lg")
 
501
  with gr.Row():
502
  enhance_prompt = gr.Checkbox(label="Enhance Prompt", value=False)
503
  high_res = gr.Checkbox(label="High Resolution", value=True)
504
+
505
+ # >>> MOVE slider OUTSIDE the row
506
+ lora_strength = gr.Slider(
507
+ label="LoRA Strength",
508
+ info="Scale for the LoRA weights (0.0 = off). Set near 1.0 for full effect.",
509
+ minimum=0.0,
510
+ maximum=2.0,
511
+ value=1.0,
512
+ step=0.01,
513
+ )
514
 
515
  with gr.Column():
516
  output_video = gr.Video(label="Generated Video", autoplay=False)
 
533
  True,
534
  1024,
535
  1024,
536
+ 1.0,
537
  ],
538
  ],
539
  inputs=[