Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -304,7 +304,7 @@ print("=" * 80)
|
|
| 304 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 305 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_reasoning_I2V_V3.safetensors")
|
| 306 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
| 307 |
-
dreamlay_lora_path = hf_hub_download(repo_id=
|
| 308 |
mself_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Furry Hyper Masturbation - LTX-2 I2V v1.safetensors") # Hyperfap
|
| 309 |
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?)
|
| 310 |
fluid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_CREAMPIE_ANIMATION-V0.1.safetensors") # cum
|
|
@@ -331,6 +331,7 @@ print(f"Realism LoRA: {realism_lora_path}")
|
|
| 331 |
print(f"Transition LoRA: {transition_lora_path}")
|
| 332 |
print(f"Physics LoRA: {physics_lora_path}")
|
| 333 |
print(f"Reasoning LoRA: {reasoning_lora_path}")
|
|
|
|
| 334 |
# ----------------------------------------------------------------
|
| 335 |
|
| 336 |
print(f"Checkpoint: {checkpoint_path}")
|
|
@@ -348,7 +349,7 @@ pipeline = LTX23DistilledA2VPipeline(
|
|
| 348 |
)
|
| 349 |
# ----------------------------------------------------------------
|
| 350 |
|
| 351 |
-
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, voice_strength: float, realism_strength: float, transition_strength: float, physics_strength: float, reasoning_strength: float) -> tuple[str, str]:
|
| 352 |
rp = round(float(pose_strength), 2)
|
| 353 |
rg = round(float(general_strength), 2)
|
| 354 |
rm = round(float(motion_strength), 2)
|
|
@@ -363,7 +364,8 @@ def _make_lora_key(pose_strength: float, general_strength: float, motion_strengt
|
|
| 363 |
rt = round(float(transition_strength), 2)
|
| 364 |
ry = round(float(physics_strength), 2)
|
| 365 |
ri = round(float(reasoning_strength), 2)
|
| 366 |
-
|
|
|
|
| 367 |
key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
|
| 368 |
return key, key_str
|
| 369 |
|
|
@@ -383,6 +385,7 @@ def prepare_lora_cache(
|
|
| 383 |
transition_strength: float,
|
| 384 |
physics_strength: float,
|
| 385 |
reasoning_strength: float,
|
|
|
|
| 386 |
progress=gr.Progress(track_tqdm=True),
|
| 387 |
):
|
| 388 |
"""
|
|
@@ -395,7 +398,7 @@ def prepare_lora_cache(
|
|
| 395 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 396 |
|
| 397 |
ledger = pipeline.model_ledger
|
| 398 |
-
key, _ = _make_lora_key(pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength)
|
| 399 |
cache_path = LORA_CACHE_DIR / f"{key}.safetensors"
|
| 400 |
|
| 401 |
progress(0.05, desc="Preparing LoRA state")
|
|
@@ -425,6 +428,7 @@ def prepare_lora_cache(
|
|
| 425 |
(transition_lora_path, round(float(transition_strength), 2)),
|
| 426 |
(physics_lora_path, round(float(physics_strength), 2)),
|
| 427 |
(reasoning_lora_path, round(float(reasoning_strength), 2)),
|
|
|
|
| 428 |
]
|
| 429 |
loras_for_builder = [
|
| 430 |
LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)
|
|
@@ -623,6 +627,7 @@ def get_gpu_duration(
|
|
| 623 |
transition_strength: float = 0.0,
|
| 624 |
physics_strength: float = 0.0,
|
| 625 |
reasoning_strength: float = 0.0,
|
|
|
|
| 626 |
progress=None,
|
| 627 |
):
|
| 628 |
return int(gpu_duration)
|
|
@@ -655,6 +660,7 @@ def generate_video(
|
|
| 655 |
transition_strength: float = 0.0,
|
| 656 |
physics_strength: float = 0.0,
|
| 657 |
reasoning_strength: float = 0.0,
|
|
|
|
| 658 |
progress=gr.Progress(track_tqdm=True),
|
| 659 |
):
|
| 660 |
try:
|
|
@@ -816,7 +822,11 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 816 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 817 |
)
|
| 818 |
reasoning_strength = gr.Slider(
|
| 819 |
-
label="
|
|
|
|
|
|
|
|
|
|
|
|
|
| 820 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 821 |
)
|
| 822 |
prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")
|
|
@@ -869,12 +879,13 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 869 |
0.0,
|
| 870 |
0.0,
|
| 871 |
0.0,
|
|
|
|
| 872 |
],
|
| 873 |
],
|
| 874 |
inputs=[
|
| 875 |
first_image, last_image, input_audio, prompt, duration, gpu_duration,
|
| 876 |
enhance_prompt, seed, randomize_seed, height, width,
|
| 877 |
-
pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength,
|
| 878 |
],
|
| 879 |
)
|
| 880 |
|
|
@@ -898,7 +909,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 898 |
|
| 899 |
prepare_lora_btn.click(
|
| 900 |
fn=prepare_lora_cache,
|
| 901 |
-
inputs=[pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength],
|
| 902 |
outputs=[lora_status],
|
| 903 |
)
|
| 904 |
|
|
@@ -907,7 +918,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 907 |
inputs=[
|
| 908 |
first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
|
| 909 |
seed, randomize_seed, height, width,
|
| 910 |
-
pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength,
|
| 911 |
],
|
| 912 |
outputs=[output_video, seed],
|
| 913 |
)
|
|
|
|
| 304 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 305 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_reasoning_I2V_V3.safetensors")
|
| 306 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
| 307 |
+
dreamlay_lora_path = hf_hub_download(repo_id="lynaNSFW/DR34ML4Y_AIO_NSFW_LTX23", filename="DR34ML4Y_LTXXX_V1.safetensors") # m15510n4ry, bl0wj0b, d0ubl3_bj, d0gg1e, c0wg1rl
|
| 308 |
mself_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Furry Hyper Masturbation - LTX-2 I2V v1.safetensors") # Hyperfap
|
| 309 |
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?)
|
| 310 |
fluid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_CREAMPIE_ANIMATION-V0.1.safetensors") # cum
|
|
|
|
| 331 |
print(f"Transition LoRA: {transition_lora_path}")
|
| 332 |
print(f"Physics LoRA: {physics_lora_path}")
|
| 333 |
print(f"Reasoning LoRA: {reasoning_lora_path}")
|
| 334 |
+
print(f"Twostep LoRA: {twostep_lora_path}")
|
| 335 |
# ----------------------------------------------------------------
|
| 336 |
|
| 337 |
print(f"Checkpoint: {checkpoint_path}")
|
|
|
|
| 349 |
)
|
| 350 |
# ----------------------------------------------------------------
|
| 351 |
|
| 352 |
+
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, voice_strength: float, realism_strength: float, transition_strength: float, physics_strength: float, reasoning_strength: float, twostep_strength: float) -> tuple[str, str]:
|
| 353 |
rp = round(float(pose_strength), 2)
|
| 354 |
rg = round(float(general_strength), 2)
|
| 355 |
rm = round(float(motion_strength), 2)
|
|
|
|
| 364 |
rt = round(float(transition_strength), 2)
|
| 365 |
ry = round(float(physics_strength), 2)
|
| 366 |
ri = round(float(reasoning_strength), 2)
|
| 367 |
+
rw = round(float(twostep_strength), 2)
|
| 368 |
+
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}|{voice_lora_path}:{rv}|{realism_lora_path}:{re}|{transition_lora_path}:{rt}|{physics_lora_path}:{ry}|{reasoning_lora_path}:{ri}|{twostep_lora_path}:{rw}"
|
| 369 |
key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
|
| 370 |
return key, key_str
|
| 371 |
|
|
|
|
| 385 |
transition_strength: float,
|
| 386 |
physics_strength: float,
|
| 387 |
reasoning_strength: float,
|
| 388 |
+
twostep_strength: float,
|
| 389 |
progress=gr.Progress(track_tqdm=True),
|
| 390 |
):
|
| 391 |
"""
|
|
|
|
| 398 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 399 |
|
| 400 |
ledger = pipeline.model_ledger
|
| 401 |
+
key, _ = _make_lora_key(pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength, twostep_strength)
|
| 402 |
cache_path = LORA_CACHE_DIR / f"{key}.safetensors"
|
| 403 |
|
| 404 |
progress(0.05, desc="Preparing LoRA state")
|
|
|
|
| 428 |
(transition_lora_path, round(float(transition_strength), 2)),
|
| 429 |
(physics_lora_path, round(float(physics_strength), 2)),
|
| 430 |
(reasoning_lora_path, round(float(reasoning_strength), 2)),
|
| 431 |
+
(twostep_lora_path, round(float(twostep_strength), 2)),
|
| 432 |
]
|
| 433 |
loras_for_builder = [
|
| 434 |
LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)
|
|
|
|
| 627 |
transition_strength: float = 0.0,
|
| 628 |
physics_strength: float = 0.0,
|
| 629 |
reasoning_strength: float = 0.0,
|
| 630 |
+
twostep_strength: float = 0.0,
|
| 631 |
progress=None,
|
| 632 |
):
|
| 633 |
return int(gpu_duration)
|
|
|
|
| 660 |
transition_strength: float = 0.0,
|
| 661 |
physics_strength: float = 0.0,
|
| 662 |
reasoning_strength: float = 0.0,
|
| 663 |
+
twostep_strength: float = 0.0,
|
| 664 |
progress=gr.Progress(track_tqdm=True),
|
| 665 |
):
|
| 666 |
try:
|
|
|
|
| 822 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 823 |
)
|
| 824 |
reasoning_strength = gr.Slider(
|
| 825 |
+
label="Official Reasoning strength",
|
| 826 |
+
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 827 |
+
)
|
| 828 |
+
twostep_strength = gr.Slider(
|
| 829 |
+
label="Two Step Reasoning strength",
|
| 830 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 831 |
)
|
| 832 |
prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")
|
|
|
|
| 879 |
0.0,
|
| 880 |
0.0,
|
| 881 |
0.0,
|
| 882 |
+
0.0,
|
| 883 |
],
|
| 884 |
],
|
| 885 |
inputs=[
|
| 886 |
first_image, last_image, input_audio, prompt, duration, gpu_duration,
|
| 887 |
enhance_prompt, seed, randomize_seed, height, width,
|
| 888 |
+
pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength, twostep_strength,
|
| 889 |
],
|
| 890 |
)
|
| 891 |
|
|
|
|
| 909 |
|
| 910 |
prepare_lora_btn.click(
|
| 911 |
fn=prepare_lora_cache,
|
| 912 |
+
inputs=[pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength, twostep_strength],
|
| 913 |
outputs=[lora_status],
|
| 914 |
)
|
| 915 |
|
|
|
|
| 918 |
inputs=[
|
| 919 |
first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
|
| 920 |
seed, randomize_seed, height, width,
|
| 921 |
+
pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength, twostep_strength,
|
| 922 |
],
|
| 923 |
outputs=[output_video, seed],
|
| 924 |
)
|