Update app.py
Browse files
app.py
CHANGED
|
@@ -300,10 +300,22 @@ print("=" * 80)
|
|
| 300 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 301 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Reasoning_V1.safetensors")
|
| 302 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
|
| 304 |
print(f"Pose LoRA: {pose_lora_path}")
|
| 305 |
print(f"General LoRA: {general_lora_path}")
|
| 306 |
print(f"Motion LoRA: {motion_lora_path}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
# ----------------------------------------------------------------
|
| 308 |
|
| 309 |
print(f"Checkpoint: {checkpoint_path}")
|
|
@@ -321,11 +333,17 @@ pipeline = LTX23DistilledA2VPipeline(
|
|
| 321 |
)
|
| 322 |
# ----------------------------------------------------------------
|
| 323 |
|
| 324 |
-
def _make_lora_key(pose_strength: float, general_strength: float, motion_strength: float) -> tuple[str, str]:
|
| 325 |
rp = round(float(pose_strength), 2)
|
| 326 |
rg = round(float(general_strength), 2)
|
| 327 |
rm = round(float(motion_strength), 2)
|
| 328 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 329 |
key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
|
| 330 |
return key, key_str
|
| 331 |
|
|
@@ -334,6 +352,12 @@ def prepare_lora_cache(
|
|
| 334 |
pose_strength: float,
|
| 335 |
general_strength: float,
|
| 336 |
motion_strength: float,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 337 |
progress=gr.Progress(track_tqdm=True),
|
| 338 |
):
|
| 339 |
"""
|
|
@@ -346,7 +370,7 @@ def prepare_lora_cache(
|
|
| 346 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 347 |
|
| 348 |
ledger = pipeline.model_ledger
|
| 349 |
-
key, _ = _make_lora_key(pose_strength, general_strength, motion_strength)
|
| 350 |
cache_path = LORA_CACHE_DIR / f"{key}.pt"
|
| 351 |
|
| 352 |
progress(0.05, desc="Preparing LoRA state")
|
|
@@ -365,6 +389,12 @@ def prepare_lora_cache(
|
|
| 365 |
(pose_lora_path, round(float(pose_strength), 2)),
|
| 366 |
(general_lora_path, round(float(general_strength), 2)),
|
| 367 |
(motion_lora_path, round(float(motion_strength), 2)),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
]
|
| 369 |
loras_for_builder = [
|
| 370 |
LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)
|
|
@@ -554,6 +584,12 @@ def get_gpu_duration(
|
|
| 554 |
pose_strength: float = 0.0,
|
| 555 |
general_strength: float = 0.0,
|
| 556 |
motion_strength: float = 0.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 557 |
progress=None,
|
| 558 |
):
|
| 559 |
return int(gpu_duration)
|
|
@@ -575,6 +611,12 @@ def generate_video(
|
|
| 575 |
pose_strength: float = 0.0,
|
| 576 |
general_strength: float = 0.0,
|
| 577 |
motion_strength: float = 0.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 578 |
progress=gr.Progress(track_tqdm=True),
|
| 579 |
):
|
| 580 |
try:
|
|
@@ -650,8 +692,8 @@ def generate_video(
|
|
| 650 |
return None, current_seed
|
| 651 |
|
| 652 |
|
| 653 |
-
with gr.Blocks(title="LTX-2.3
|
| 654 |
-
gr.Markdown("# LTX-2.3 F2LF
|
| 655 |
|
| 656 |
|
| 657 |
with gr.Row():
|
|
@@ -684,15 +726,39 @@ with gr.Blocks(title="LTX-2.3 Heretic Distilled") as demo:
|
|
| 684 |
with gr.Column():
|
| 685 |
gr.Markdown("### LoRA adapter strengths (set to 0 to disable)")
|
| 686 |
pose_strength = gr.Slider(
|
| 687 |
-
label="
|
| 688 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 689 |
)
|
| 690 |
general_strength = gr.Slider(
|
| 691 |
-
label="
|
| 692 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 693 |
)
|
| 694 |
motion_strength = gr.Slider(
|
| 695 |
-
label="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 696 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 697 |
)
|
| 698 |
prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")
|
|
@@ -734,12 +800,18 @@ with gr.Blocks(title="LTX-2.3 Heretic Distilled") as demo:
|
|
| 734 |
0.0, # pose_strength (example)
|
| 735 |
0.0, # general_strength (example)
|
| 736 |
0.0, # motion_strength (example)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 737 |
],
|
| 738 |
],
|
| 739 |
inputs=[
|
| 740 |
first_image, last_image, input_audio, prompt, duration, gpu_duration,
|
| 741 |
enhance_prompt, seed, randomize_seed, height, width,
|
| 742 |
-
pose_strength, general_strength, motion_strength,
|
| 743 |
],
|
| 744 |
)
|
| 745 |
|
|
@@ -763,7 +835,7 @@ with gr.Blocks(title="LTX-2.3 Heretic Distilled") as demo:
|
|
| 763 |
|
| 764 |
prepare_lora_btn.click(
|
| 765 |
fn=prepare_lora_cache,
|
| 766 |
-
inputs=[pose_strength, general_strength, motion_strength],
|
| 767 |
outputs=[lora_status],
|
| 768 |
)
|
| 769 |
|
|
@@ -772,7 +844,7 @@ with gr.Blocks(title="LTX-2.3 Heretic Distilled") as demo:
|
|
| 772 |
inputs=[
|
| 773 |
first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
|
| 774 |
seed, randomize_seed, height, width,
|
| 775 |
-
pose_strength, general_strength, motion_strength,
|
| 776 |
],
|
| 777 |
outputs=[output_video, seed],
|
| 778 |
)
|
|
|
|
| 300 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 301 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Reasoning_V1.safetensors")
|
| 302 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
| 303 |
+
dreamlay_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="DR34ML4Y_LTXXX_PREVIEW_RC1.safetensors") # m15510n4ry, bl0wj0b, d0ubl3_bj, d0gg1e, c0wg1rl
|
| 304 |
+
mself_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Furry Hyper Masturbation - LTX-2 I2V v1.safetensors") # Hyperfap
|
| 305 |
+
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?)
|
| 306 |
+
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
|
| 307 |
+
liquid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="liquid_wet_dr1pp_ltx2_v1.0_scaled.safetensors") # wet dr1pp
|
| 308 |
+
demopose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="ltx23__demopose_d3m0p0s3.safetensors") # d3m0p0s3
|
| 309 |
|
| 310 |
print(f"Pose LoRA: {pose_lora_path}")
|
| 311 |
print(f"General LoRA: {general_lora_path}")
|
| 312 |
print(f"Motion LoRA: {motion_lora_path}")
|
| 313 |
+
print(f"Dreamlay LoRA: {dreamlay_lora_path}")
|
| 314 |
+
print(f"Mself LoRA: {mself_lora_path}")
|
| 315 |
+
print(f"Dramatic LoRA: {dramatic_lora_path}")
|
| 316 |
+
print(f"Fluid LoRA: {fluid_lora_path}")
|
| 317 |
+
print(f"Liquid LoRA: {liquid_lora_path}")
|
| 318 |
+
print(f"Demopose LoRA: {demopose_lora_path}")
|
| 319 |
# ----------------------------------------------------------------
|
| 320 |
|
| 321 |
print(f"Checkpoint: {checkpoint_path}")
|
|
|
|
| 333 |
)
|
| 334 |
# ----------------------------------------------------------------
|
| 335 |
|
| 336 |
+
def _make_lora_key(pose_strength: float, general_strength: float, motion_strength: float, dreamlay_strength: float, mself_stength: float, dramatic_strength: float, fluid_strength: float, liquid_strength: float, demopose_strength: float) -> tuple[str, str]:
|
| 337 |
rp = round(float(pose_strength), 2)
|
| 338 |
rg = round(float(general_strength), 2)
|
| 339 |
rm = round(float(motion_strength), 2)
|
| 340 |
+
rd = round(float(dreamlay_strength), 2)
|
| 341 |
+
rs = round(float(mself_strength), 2)
|
| 342 |
+
rr = round(float(dramatic_strength), 2)
|
| 343 |
+
rf = round(float(fluid_strength), 2)
|
| 344 |
+
rl = round(float(liquid_strength), 2)
|
| 345 |
+
ro = round(float(demopose_strength), 2)
|
| 346 |
+
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}"
|
| 347 |
key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
|
| 348 |
return key, key_str
|
| 349 |
|
|
|
|
| 352 |
pose_strength: float,
|
| 353 |
general_strength: float,
|
| 354 |
motion_strength: float,
|
| 355 |
+
dreamlay_strength: float,
|
| 356 |
+
mself_strength: float,
|
| 357 |
+
dramatic_strength: float,
|
| 358 |
+
fluid_strength: float,
|
| 359 |
+
liquid_strength: float,
|
| 360 |
+
demopose_strength: float,
|
| 361 |
progress=gr.Progress(track_tqdm=True),
|
| 362 |
):
|
| 363 |
"""
|
|
|
|
| 370 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 371 |
|
| 372 |
ledger = pipeline.model_ledger
|
| 373 |
+
key, _ = _make_lora_key(pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength)
|
| 374 |
cache_path = LORA_CACHE_DIR / f"{key}.pt"
|
| 375 |
|
| 376 |
progress(0.05, desc="Preparing LoRA state")
|
|
|
|
| 389 |
(pose_lora_path, round(float(pose_strength), 2)),
|
| 390 |
(general_lora_path, round(float(general_strength), 2)),
|
| 391 |
(motion_lora_path, round(float(motion_strength), 2)),
|
| 392 |
+
(dreamlay_lora_path, round(float(dreamlay_strength), 2)),
|
| 393 |
+
(mself_lora_path, round(float(mself_strength), 2)),
|
| 394 |
+
(dramatic_lora_path, round(float(dramatic_strength), 2)),
|
| 395 |
+
(fluid_lora_path, round(float(fluid_strength), 2)),
|
| 396 |
+
(liquid_lora_path, round(float(liquid_strength), 2)),
|
| 397 |
+
(demopose_lora_path, round(float(demopose_strength), 2)),
|
| 398 |
]
|
| 399 |
loras_for_builder = [
|
| 400 |
LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)
|
|
|
|
| 584 |
pose_strength: float = 0.0,
|
| 585 |
general_strength: float = 0.0,
|
| 586 |
motion_strength: float = 0.0,
|
| 587 |
+
dreamlay_strength: float = 0.0,
|
| 588 |
+
mself_strength: float = 0.0,
|
| 589 |
+
dramatic_strength: float = 0.0,
|
| 590 |
+
fluid_strength: float = 0.0,
|
| 591 |
+
liquid_strength: float = 0.0,
|
| 592 |
+
demopose_strength: float = 0.0,
|
| 593 |
progress=None,
|
| 594 |
):
|
| 595 |
return int(gpu_duration)
|
|
|
|
| 611 |
pose_strength: float = 0.0,
|
| 612 |
general_strength: float = 0.0,
|
| 613 |
motion_strength: float = 0.0,
|
| 614 |
+
dreamlay_strength: float = 0.0,
|
| 615 |
+
mself_strength: float = 0.0,
|
| 616 |
+
dramatic_strength: float = 0.0,
|
| 617 |
+
fluid_strength: float = 0.0,
|
| 618 |
+
liquid_strength: float = 0.0,
|
| 619 |
+
demopose_strength: float = 0.0,
|
| 620 |
progress=gr.Progress(track_tqdm=True),
|
| 621 |
):
|
| 622 |
try:
|
|
|
|
| 692 |
return None, current_seed
|
| 693 |
|
| 694 |
|
| 695 |
+
with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
| 696 |
+
gr.Markdown("# LTX-2.3 F2LF with Fast Audio-Video Generation with Frame Conditioning")
|
| 697 |
|
| 698 |
|
| 699 |
with gr.Row():
|
|
|
|
| 726 |
with gr.Column():
|
| 727 |
gr.Markdown("### LoRA adapter strengths (set to 0 to disable)")
|
| 728 |
pose_strength = gr.Slider(
|
| 729 |
+
label="Anthro Enhancer strength",
|
| 730 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 731 |
)
|
| 732 |
general_strength = gr.Slider(
|
| 733 |
+
label="Reasoning Enhancer strength",
|
| 734 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 735 |
)
|
| 736 |
motion_strength = gr.Slider(
|
| 737 |
+
label="Anthro Posing Helper strength",
|
| 738 |
+
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 739 |
+
)
|
| 740 |
+
motion_strength = gr.Slider(
|
| 741 |
+
label="Dreamlay strength",
|
| 742 |
+
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 743 |
+
)
|
| 744 |
+
motion_strength = gr.Slider(
|
| 745 |
+
label="Mself strength",
|
| 746 |
+
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 747 |
+
)
|
| 748 |
+
motion_strength = gr.Slider(
|
| 749 |
+
label="Dramatic strength",
|
| 750 |
+
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 751 |
+
)
|
| 752 |
+
motion_strength = gr.Slider(
|
| 753 |
+
label="Fluid Helper strength",
|
| 754 |
+
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 755 |
+
)
|
| 756 |
+
motion_strength = gr.Slider(
|
| 757 |
+
label="Liquid Helper strength",
|
| 758 |
+
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 759 |
+
)
|
| 760 |
+
motion_strength = gr.Slider(
|
| 761 |
+
label="Demopose Helper strength",
|
| 762 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 763 |
)
|
| 764 |
prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")
|
|
|
|
| 800 |
0.0, # pose_strength (example)
|
| 801 |
0.0, # general_strength (example)
|
| 802 |
0.0, # motion_strength (example)
|
| 803 |
+
0.0,
|
| 804 |
+
0.0,
|
| 805 |
+
0.0,
|
| 806 |
+
0.0,
|
| 807 |
+
0.0,
|
| 808 |
+
0.0,
|
| 809 |
],
|
| 810 |
],
|
| 811 |
inputs=[
|
| 812 |
first_image, last_image, input_audio, prompt, duration, gpu_duration,
|
| 813 |
enhance_prompt, seed, randomize_seed, height, width,
|
| 814 |
+
pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength,
|
| 815 |
],
|
| 816 |
)
|
| 817 |
|
|
|
|
| 835 |
|
| 836 |
prepare_lora_btn.click(
|
| 837 |
fn=prepare_lora_cache,
|
| 838 |
+
inputs=[pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength],
|
| 839 |
outputs=[lora_status],
|
| 840 |
)
|
| 841 |
|
|
|
|
| 844 |
inputs=[
|
| 845 |
first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
|
| 846 |
seed, randomize_seed, height, width,
|
| 847 |
+
pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength,
|
| 848 |
],
|
| 849 |
outputs=[output_video, seed],
|
| 850 |
)
|