dagloop5 commited on
Commit
56b565f
·
verified ·
1 Parent(s): e6a0cbb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -10
app.py CHANGED
@@ -338,6 +338,7 @@ LORA_REPO = "dagloop5/LoRA"
338
  print("=" * 80)
339
  print("Downloading LoRA adapters from dagloop5/LoRA...")
340
  print("=" * 80)
 
341
  pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
342
  general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_VBVR_Reasoning_I2V_V2.safetensors")
343
  motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
@@ -345,9 +346,13 @@ dreamlay_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="DR34ML4Y_LTXXX
345
  mself_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Furry Hyper Masturbation - LTX-2 I2V v1.safetensors") # Hyperfap
346
  dramatic_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX-2.3 - Orgasm.safetensors") # "[He | She] is having am orgasm." (am or an?)
347
  fluid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="cr3ampi3_animation_i2v_ltx2_v1.0.safetensors") # cr3ampi3 animation., missionary animation, doggystyle bouncy animation, double penetration animation
348
- liquid_lora_path = hf_hub_download(repo_id="valiantcat/LTX-2.3-Transition-LORA", filename="ltx2.3-transition.safetensors") # wet dr1pp
349
- demopose_lora_path = hf_hub_download(repo_id=LTX_MODEL_REPO, filename=DISTILLED_LORA_FILE)
 
 
 
350
 
 
351
  print(f"Pose LoRA: {pose_lora_path}")
352
  print(f"General LoRA: {general_lora_path}")
353
  print(f"Motion LoRA: {motion_lora_path}")
@@ -357,6 +362,9 @@ print(f"Dramatic LoRA: {dramatic_lora_path}")
357
  print(f"Fluid LoRA: {fluid_lora_path}")
358
  print(f"Liquid LoRA: {liquid_lora_path}")
359
  print(f"Demopose LoRA: {demopose_lora_path}")
 
 
 
360
  # ----------------------------------------------------------------
361
 
362
  print(f"Checkpoint: {checkpoint_path}")
@@ -374,7 +382,8 @@ pipeline = LTX23DistilledA2VPipeline(
374
  )
375
  # ----------------------------------------------------------------
376
 
377
- def _make_lora_key(pose_strength: float, general_strength: float, motion_strength: float, dreamlay_strength: float, mself_strength: float, dramatic_strength: float, fluid_strength: float, liquid_strength: float, demopose_strength: float) -> tuple[str, str]:
 
378
  rp = round(float(pose_strength), 2)
379
  rg = round(float(general_strength), 2)
380
  rm = round(float(motion_strength), 2)
@@ -384,12 +393,16 @@ def _make_lora_key(pose_strength: float, general_strength: float, motion_strengt
384
  rf = round(float(fluid_strength), 2)
385
  rl = round(float(liquid_strength), 2)
386
  ro = round(float(demopose_strength), 2)
387
- key_str = f"{pose_lora_path}:{rp}|{general_lora_path}:{rg}|{motion_lora_path}:{rm}|{dreamlay_lora_path}:{rd}|{mself_lora_path}:{rs}|{dramatic_lora_path}:{rr}|{fluid_lora_path}:{rf}|{liquid_lora_path}:{rl}|{demopose_lora_path}:{ro}"
 
 
 
388
  key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
389
  return key, key_str
390
 
391
 
392
  def prepare_lora_cache(
 
393
  pose_strength: float,
394
  general_strength: float,
395
  motion_strength: float,
@@ -399,6 +412,9 @@ def prepare_lora_cache(
399
  fluid_strength: float,
400
  liquid_strength: float,
401
  demopose_strength: float,
 
 
 
402
  progress=gr.Progress(track_tqdm=True),
403
  ):
404
  """
@@ -411,7 +427,7 @@ def prepare_lora_cache(
411
  global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
412
 
413
  ledger = pipeline.model_ledger
414
- key, _ = _make_lora_key(pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength)
415
  cache_path = LORA_CACHE_DIR / f"{key}.safetensors"
416
 
417
  progress(0.05, desc="Preparing LoRA state")
@@ -427,6 +443,7 @@ def prepare_lora_cache(
427
  print(f"[LoRA] Cache load failed: {type(e).__name__}: {e}")
428
 
429
  entries = [
 
430
  (pose_lora_path, round(float(pose_strength), 2)),
431
  (general_lora_path, round(float(general_strength), 2)),
432
  (motion_lora_path, round(float(motion_strength), 2)),
@@ -436,6 +453,9 @@ def prepare_lora_cache(
436
  (fluid_lora_path, round(float(fluid_strength), 2)),
437
  (liquid_lora_path, round(float(liquid_strength), 2)),
438
  (demopose_lora_path, round(float(demopose_strength), 2)),
 
 
 
439
  ]
440
  loras_for_builder = [
441
  LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)
@@ -620,6 +640,7 @@ def get_gpu_duration(
620
  randomize_seed: bool = True,
621
  height: int = 1024,
622
  width: int = 1536,
 
623
  pose_strength: float = 0.0,
624
  general_strength: float = 0.0,
625
  motion_strength: float = 0.0,
@@ -629,6 +650,9 @@ def get_gpu_duration(
629
  fluid_strength: float = 0.0,
630
  liquid_strength: float = 0.0,
631
  demopose_strength: float = 0.0,
 
 
 
632
  progress=None,
633
  ):
634
  return int(gpu_duration)
@@ -647,6 +671,7 @@ def generate_video(
647
  randomize_seed: bool = True,
648
  height: int = 1024,
649
  width: int = 1536,
 
650
  pose_strength: float = 0.0,
651
  general_strength: float = 0.0,
652
  motion_strength: float = 0.0,
@@ -656,6 +681,9 @@ def generate_video(
656
  fluid_strength: float = 0.0,
657
  liquid_strength: float = 0.0,
658
  demopose_strength: float = 0.0,
 
 
 
659
  progress=gr.Progress(track_tqdm=True),
660
  ):
661
  try:
@@ -764,6 +792,10 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
764
  high_res = gr.Checkbox(label="High Resolution", value=True)
765
  with gr.Column():
766
  gr.Markdown("### LoRA adapter strengths (set to 0 to disable; slow and WIP)")
 
 
 
 
767
  pose_strength = gr.Slider(
768
  label="Anthro Enhancer strength",
769
  minimum=0.0, maximum=2.0, value=0.0, step=0.01
@@ -793,11 +825,23 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
793
  minimum=0.0, maximum=2.0, value=0.0, step=0.01
794
  )
795
  liquid_strength = gr.Slider(
796
- label="Transition Helper strength",
797
  minimum=0.0, maximum=2.0, value=0.0, step=0.01
798
  )
799
  demopose_strength = gr.Slider(
800
- label="Distilled strength",
 
 
 
 
 
 
 
 
 
 
 
 
801
  minimum=0.0, maximum=2.0, value=0.0, step=0.01
802
  )
803
  prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")
@@ -836,6 +880,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
836
  True,
837
  1024,
838
  1024,
 
839
  0.0, # pose_strength (example)
840
  0.0, # general_strength (example)
841
  0.0, # motion_strength (example)
@@ -845,12 +890,15 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
845
  0.0,
846
  0.0,
847
  0.0,
 
 
 
848
  ],
849
  ],
850
  inputs=[
851
  first_image, last_image, input_audio, prompt, duration, gpu_duration,
852
  enhance_prompt, seed, randomize_seed, height, width,
853
- pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength,
854
  ],
855
  )
856
 
@@ -874,7 +922,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
874
 
875
  prepare_lora_btn.click(
876
  fn=prepare_lora_cache,
877
- inputs=[pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength],
878
  outputs=[lora_status],
879
  )
880
 
@@ -883,7 +931,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
883
  inputs=[
884
  first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
885
  seed, randomize_seed, height, width,
886
- pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength,
887
  ],
888
  outputs=[output_video, seed],
889
  )
 
338
  print("=" * 80)
339
  print("Downloading LoRA adapters from dagloop5/LoRA...")
340
  print("=" * 80)
341
+ distilled_lora_path = hf_hub_download(repo_id=LTX_MODEL_REPO, filename=DISTILLED_LORA_FILE)
342
  pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
343
  general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_VBVR_Reasoning_I2V_V2.safetensors")
344
  motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
 
346
  mself_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Furry Hyper Masturbation - LTX-2 I2V v1.safetensors") # Hyperfap
347
  dramatic_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX-2.3 - Orgasm.safetensors") # "[He | She] is having am orgasm." (am or an?)
348
  fluid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="cr3ampi3_animation_i2v_ltx2_v1.0.safetensors") # cr3ampi3 animation., missionary animation, doggystyle bouncy animation, double penetration animation
349
+ liquid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="liquid_wet_dr1pp_ltx2_v1.0_scaled.safetensors") # wet dr1pp
350
+ demopose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="clapping-cheeks-audio-v001-alpha.safetensors")
351
+ voice_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="hentai_voice_ltx23.safetensors")
352
+ realism_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="FurryenhancerLTX2.3V1.215.safetensors")
353
+ transition_lora_path = hf_hub_download(repo_id="valiantcat/LTX-2.3-Transition-LORA", filename="ltx2.3-transition.safetensors")
354
 
355
+ print(f"Distilled LoRA: {distilled_lora_path}")
356
  print(f"Pose LoRA: {pose_lora_path}")
357
  print(f"General LoRA: {general_lora_path}")
358
  print(f"Motion LoRA: {motion_lora_path}")
 
362
  print(f"Fluid LoRA: {fluid_lora_path}")
363
  print(f"Liquid LoRA: {liquid_lora_path}")
364
  print(f"Demopose LoRA: {demopose_lora_path}")
365
+ print(f"Voice LoRA: {voice_lora_path}")
366
+ print(f"Realism LoRA: {realism_lora_path}")
367
+ print(f"Transition LoRA: {transition_lora_path}")
368
  # ----------------------------------------------------------------
369
 
370
  print(f"Checkpoint: {checkpoint_path}")
 
382
  )
383
  # ----------------------------------------------------------------
384
 
385
+ def _make_lora_key(distilled_strength: float, pose_strength: float, general_strength: float, motion_strength: float, dreamlay_strength: float, mself_strength: float, dramatic_strength: float, fluid_strength: float, liquid_strength: float, demopose_strength: float, voice_strength: float, realism_strength: float, transition_strength: float) -> tuple[str, str]:
386
+ rn = round(float(pose_strength), 2)
387
  rp = round(float(pose_strength), 2)
388
  rg = round(float(general_strength), 2)
389
  rm = round(float(motion_strength), 2)
 
393
  rf = round(float(fluid_strength), 2)
394
  rl = round(float(liquid_strength), 2)
395
  ro = round(float(demopose_strength), 2)
396
+ rv = round(float(voice_strength), 2)
397
+ re = round(float(realism_strength), 2)
398
+ rt = round(float(transition_strength), 2)
399
+ key_str = f"{distilled_lora_path}:{rn}|{pose_lora_path}:{rp}|{general_lora_path}:{rg}|{motion_lora_path}:{rm}|{dreamlay_lora_path}:{rd}|{mself_lora_path}:{rs}|{dramatic_lora_path}:{rr}|{fluid_lora_path}:{rf}|{liquid_lora_path}:{rl}|{demopose_lora_path}:{ro}|{voice_lora_path}:{rv}|{realism_lora_path}:{re}|{transition_lora_path}:{rt}"
400
  key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
401
  return key, key_str
402
 
403
 
404
  def prepare_lora_cache(
405
+ distilled_strength: float,
406
  pose_strength: float,
407
  general_strength: float,
408
  motion_strength: float,
 
412
  fluid_strength: float,
413
  liquid_strength: float,
414
  demopose_strength: float,
415
+ voice_strength: float,
416
+ realism_strength: float,
417
+ transition_strength: float,
418
  progress=gr.Progress(track_tqdm=True),
419
  ):
420
  """
 
427
  global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
428
 
429
  ledger = pipeline.model_ledger
430
+ key, _ = _make_lora_key(distilled_strength, pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength)
431
  cache_path = LORA_CACHE_DIR / f"{key}.safetensors"
432
 
433
  progress(0.05, desc="Preparing LoRA state")
 
443
  print(f"[LoRA] Cache load failed: {type(e).__name__}: {e}")
444
 
445
  entries = [
446
+ (distilled_lora_path, round(float(distilled_strength), 2)),
447
  (pose_lora_path, round(float(pose_strength), 2)),
448
  (general_lora_path, round(float(general_strength), 2)),
449
  (motion_lora_path, round(float(motion_strength), 2)),
 
453
  (fluid_lora_path, round(float(fluid_strength), 2)),
454
  (liquid_lora_path, round(float(liquid_strength), 2)),
455
  (demopose_lora_path, round(float(demopose_strength), 2)),
456
+ (voice_lora_path, round(float(voice_strength), 2)),
457
+ (realism_lora_path, round(float(realism_strength), 2)),
458
+ (transition_lora_path, round(float(transition_strength), 2)),
459
  ]
460
  loras_for_builder = [
461
  LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)
 
640
  randomize_seed: bool = True,
641
  height: int = 1024,
642
  width: int = 1536,
643
+ distilled_strength: float = 0.0,
644
  pose_strength: float = 0.0,
645
  general_strength: float = 0.0,
646
  motion_strength: float = 0.0,
 
650
  fluid_strength: float = 0.0,
651
  liquid_strength: float = 0.0,
652
  demopose_strength: float = 0.0,
653
+ voice_strength: float = 0.0,
654
+ realism_strength: float = 0.0,
655
+ transition_strength: float = 0.0,
656
  progress=None,
657
  ):
658
  return int(gpu_duration)
 
671
  randomize_seed: bool = True,
672
  height: int = 1024,
673
  width: int = 1536,
674
+ distilled_strength: float = 0.0,
675
  pose_strength: float = 0.0,
676
  general_strength: float = 0.0,
677
  motion_strength: float = 0.0,
 
681
  fluid_strength: float = 0.0,
682
  liquid_strength: float = 0.0,
683
  demopose_strength: float = 0.0,
684
+ voice_strength: float = 0.0,
685
+ realism_strength: float = 0.0,
686
+ transition_strength: float = 0.0,
687
  progress=gr.Progress(track_tqdm=True),
688
  ):
689
  try:
 
792
  high_res = gr.Checkbox(label="High Resolution", value=True)
793
  with gr.Column():
794
  gr.Markdown("### LoRA adapter strengths (set to 0 to disable; slow and WIP)")
795
+ distilled_strength = gr.Slider(
796
+ label="Distilled LoRA strength (required!)",
797
+ minimum=0.0, maximum=2.0, value=0.9, step=0.01
798
+ )
799
  pose_strength = gr.Slider(
800
  label="Anthro Enhancer strength",
801
  minimum=0.0, maximum=2.0, value=0.0, step=0.01
 
825
  minimum=0.0, maximum=2.0, value=0.0, step=0.01
826
  )
827
  liquid_strength = gr.Slider(
828
+ label="Liquid Helper strength",
829
  minimum=0.0, maximum=2.0, value=0.0, step=0.01
830
  )
831
  demopose_strength = gr.Slider(
832
+ label="Audio Helper strength",
833
+ minimum=0.0, maximum=2.0, value=0.0, step=0.01
834
+ )
835
+ voice_strength = gr.Slider(
836
+ label="Voice Helper strength",
837
+ minimum=0.0, maximum=2.0, value=0.0, step=0.01
838
+ )
839
+ realism_strength = gr.Slider(
840
+ label="Anthro Realism strength",
841
+ minimum=0.0, maximum=2.0, value=0.0, step=0.01
842
+ )
843
+ transition_strength = gr.Slider(
844
+ label="Transition strength",
845
  minimum=0.0, maximum=2.0, value=0.0, step=0.01
846
  )
847
  prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")
 
880
  True,
881
  1024,
882
  1024,
883
+ 0.0,
884
  0.0, # pose_strength (example)
885
  0.0, # general_strength (example)
886
  0.0, # motion_strength (example)
 
890
  0.0,
891
  0.0,
892
  0.0,
893
+ 0.0,
894
+ 0.0,
895
+ 0.0,
896
  ],
897
  ],
898
  inputs=[
899
  first_image, last_image, input_audio, prompt, duration, gpu_duration,
900
  enhance_prompt, seed, randomize_seed, height, width,
901
+ distilled_strength, pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength,
902
  ],
903
  )
904
 
 
922
 
923
  prepare_lora_btn.click(
924
  fn=prepare_lora_cache,
925
+ inputs=[distilled_strength, pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength],
926
  outputs=[lora_status],
927
  )
928
 
 
931
  inputs=[
932
  first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
933
  seed, randomize_seed, height, width,
934
+ distilled_strength, pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength,
935
  ],
936
  outputs=[output_video, seed],
937
  )