Rename app(xformerattempt).py to app.py
Browse files- app(xformerattempt).py → app.py +33 -12
app(xformerattempt).py → app.py
RENAMED
|
@@ -373,8 +373,6 @@ spatial_upsampler_path = hf_hub_download(repo_id="Lightricks/LTX-2.3", filename=
|
|
| 373 |
gemma_root = snapshot_download(repo_id=GEMMA_REPO)
|
| 374 |
|
| 375 |
|
| 376 |
-
# ---- Insert block (LoRA downloads) between lines 268 and 269 ----
|
| 377 |
-
# LoRA repo + download the requested LoRA adapters
|
| 378 |
LORA_REPO = "dagloop5/LoRA"
|
| 379 |
|
| 380 |
print("=" * 80)
|
|
@@ -383,15 +381,18 @@ print("=" * 80)
|
|
| 383 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 384 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_reasoning_I2V_V3.safetensors")
|
| 385 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
| 386 |
-
dreamlay_lora_path = hf_hub_download(repo_id=
|
| 387 |
mself_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Furry Hyper Masturbation - LTX-2 I2V v1.safetensors") # Hyperfap
|
| 388 |
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?)
|
| 389 |
-
fluid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="
|
| 390 |
liquid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="liquid_wet_dr1pp_ltx2_v1.0_scaled.safetensors") # wet dr1pp
|
| 391 |
demopose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="clapping-cheeks-audio-v001-alpha.safetensors")
|
| 392 |
voice_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="hentai_voice_ltx23.safetensors")
|
| 393 |
-
realism_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="FurryenhancerLTX2.
|
| 394 |
transition_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX-2_takerpov_lora_v1.2.safetensors") # takerpov1, taker pov
|
|
|
|
|
|
|
|
|
|
| 395 |
|
| 396 |
print(f"Pose LoRA: {pose_lora_path}")
|
| 397 |
print(f"General LoRA: {general_lora_path}")
|
|
@@ -405,7 +406,9 @@ print(f"Demopose LoRA: {demopose_lora_path}")
|
|
| 405 |
print(f"Voice LoRA: {voice_lora_path}")
|
| 406 |
print(f"Realism LoRA: {realism_lora_path}")
|
| 407 |
print(f"Transition LoRA: {transition_lora_path}")
|
| 408 |
-
|
|
|
|
|
|
|
| 409 |
|
| 410 |
print(f"Checkpoint: {checkpoint_path}")
|
| 411 |
print(f"Spatial upsampler: {spatial_upsampler_path}")
|
|
@@ -419,7 +422,7 @@ pipeline = LTX23DistilledA2VPipeline(
|
|
| 419 |
quantization=QuantizationPolicy.fp8_cast(),
|
| 420 |
)
|
| 421 |
|
| 422 |
-
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) -> tuple[str, str]:
|
| 423 |
rp = round(float(pose_strength), 2)
|
| 424 |
rg = round(float(general_strength), 2)
|
| 425 |
rm = round(float(motion_strength), 2)
|
|
@@ -432,7 +435,10 @@ def _make_lora_key(pose_strength: float, general_strength: float, motion_strengt
|
|
| 432 |
rv = round(float(voice_strength), 2)
|
| 433 |
re = round(float(realism_strength), 2)
|
| 434 |
rt = round(float(transition_strength), 2)
|
| 435 |
-
|
|
|
|
|
|
|
|
|
|
| 436 |
key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
|
| 437 |
return key, key_str
|
| 438 |
|
|
@@ -450,6 +456,9 @@ def prepare_lora_cache(
|
|
| 450 |
voice_strength: float,
|
| 451 |
realism_strength: float,
|
| 452 |
transition_strength: float,
|
|
|
|
|
|
|
|
|
|
| 453 |
progress=gr.Progress(track_tqdm=True),
|
| 454 |
):
|
| 455 |
"""
|
|
@@ -462,7 +471,7 @@ def prepare_lora_cache(
|
|
| 462 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 463 |
|
| 464 |
ledger = pipeline.model_ledger
|
| 465 |
-
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)
|
| 466 |
cache_path = LORA_CACHE_DIR / f"{key}.safetensors"
|
| 467 |
|
| 468 |
progress(0.05, desc="Preparing LoRA state")
|
|
@@ -490,6 +499,9 @@ def prepare_lora_cache(
|
|
| 490 |
(voice_lora_path, round(float(voice_strength), 2)),
|
| 491 |
(realism_lora_path, round(float(realism_strength), 2)),
|
| 492 |
(transition_lora_path, round(float(transition_strength), 2)),
|
|
|
|
|
|
|
|
|
|
| 493 |
]
|
| 494 |
loras_for_builder = [
|
| 495 |
LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)
|
|
@@ -692,6 +704,9 @@ def get_gpu_duration(
|
|
| 692 |
voice_strength: float = 0.0,
|
| 693 |
realism_strength: float = 0.0,
|
| 694 |
transition_strength: float = 0.0,
|
|
|
|
|
|
|
|
|
|
| 695 |
num_inference_steps: int = 8,
|
| 696 |
progress=None,
|
| 697 |
):
|
|
@@ -734,6 +749,9 @@ def generate_video(
|
|
| 734 |
voice_strength: float = 0.0,
|
| 735 |
realism_strength: float = 0.0,
|
| 736 |
transition_strength: float = 0.0,
|
|
|
|
|
|
|
|
|
|
| 737 |
num_inference_steps: int = 8,
|
| 738 |
progress=gr.Progress(track_tqdm=True),
|
| 739 |
):
|
|
@@ -971,7 +989,10 @@ with gr.Blocks(title="LTX-2.3 Distilled with LoRAs, Negative Prompting, and Adva
|
|
| 971 |
|
| 972 |
with gr.Row():
|
| 973 |
transition_strength = gr.Slider(label="POV", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 974 |
-
gr.
|
|
|
|
|
|
|
|
|
|
| 975 |
|
| 976 |
prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")
|
| 977 |
lora_status = gr.Textbox(
|
|
@@ -989,7 +1010,7 @@ with gr.Blocks(title="LTX-2.3 Distilled with LoRAs, Negative Prompting, and Adva
|
|
| 989 |
fn=prepare_lora_cache,
|
| 990 |
inputs=[pose_strength, general_strength, motion_strength, dreamlay_strength,
|
| 991 |
mself_strength, dramatic_strength, fluid_strength, liquid_strength,
|
| 992 |
-
demopose_strength, voice_strength, realism_strength, transition_strength],
|
| 993 |
outputs=[lora_status],
|
| 994 |
)
|
| 995 |
|
|
@@ -1003,7 +1024,7 @@ with gr.Blocks(title="LTX-2.3 Distilled with LoRAs, Negative Prompting, and Adva
|
|
| 1003 |
pose_strength, general_strength, motion_strength,
|
| 1004 |
dreamlay_strength, mself_strength, dramatic_strength, fluid_strength,
|
| 1005 |
liquid_strength, demopose_strength, voice_strength, realism_strength,
|
| 1006 |
-
transition_strength, num_inference_steps,
|
| 1007 |
],
|
| 1008 |
outputs=[output_video, seed],
|
| 1009 |
)
|
|
|
|
| 373 |
gemma_root = snapshot_download(repo_id=GEMMA_REPO)
|
| 374 |
|
| 375 |
|
|
|
|
|
|
|
| 376 |
LORA_REPO = "dagloop5/LoRA"
|
| 377 |
|
| 378 |
print("=" * 80)
|
|
|
|
| 381 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 382 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_reasoning_I2V_V3.safetensors")
|
| 383 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
| 384 |
+
dreamlay_lora_path = hf_hub_download(repo_id="lynaNSFW/DR34ML4Y_AIO_NSFW_LTX23", filename="DR34ML4Y_LTXXX_V2.safetensors") # m15510n4ry, bl0wj0b, d0ubl3_bj, d0gg1e, c0wg1rl
|
| 385 |
mself_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Furry Hyper Masturbation - LTX-2 I2V v1.safetensors") # Hyperfap
|
| 386 |
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?)
|
| 387 |
+
fluid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Cr3ampi3_animation_sulphur-2_i2v_v1.0.safetensors") # cr3ampi3 animation
|
| 388 |
liquid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="liquid_wet_dr1pp_ltx2_v1.0_scaled.safetensors") # wet dr1pp
|
| 389 |
demopose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="clapping-cheeks-audio-v001-alpha.safetensors")
|
| 390 |
voice_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="hentai_voice_ltx23.safetensors")
|
| 391 |
+
realism_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="FurryenhancerLTX2.3V4.094fused.safetensors")
|
| 392 |
transition_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX-2_takerpov_lora_v1.2.safetensors") # takerpov1, taker pov
|
| 393 |
+
physics_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Physics_V2_000002000.safetensors")
|
| 394 |
+
reasoning_lora_path = hf_hub_download(repo_id="LiconStudio/Ltx2.3-VBVR-lora-I2V", filename="Ltx2.3-Licon-VBVR-I2V-390K-R32.safetensors")
|
| 395 |
+
twostep_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Multi_step_video_reasoning_V0.1.safetensors")
|
| 396 |
|
| 397 |
print(f"Pose LoRA: {pose_lora_path}")
|
| 398 |
print(f"General LoRA: {general_lora_path}")
|
|
|
|
| 406 |
print(f"Voice LoRA: {voice_lora_path}")
|
| 407 |
print(f"Realism LoRA: {realism_lora_path}")
|
| 408 |
print(f"Transition LoRA: {transition_lora_path}")
|
| 409 |
+
print(f"Physics LoRA: {physics_lora_path}")
|
| 410 |
+
print(f"Reasoning LoRA: {reasoning_lora_path}")
|
| 411 |
+
print(f"Twostep LoRA: {twostep_lora_path}")
|
| 412 |
|
| 413 |
print(f"Checkpoint: {checkpoint_path}")
|
| 414 |
print(f"Spatial upsampler: {spatial_upsampler_path}")
|
|
|
|
| 422 |
quantization=QuantizationPolicy.fp8_cast(),
|
| 423 |
)
|
| 424 |
|
| 425 |
+
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]:
|
| 426 |
rp = round(float(pose_strength), 2)
|
| 427 |
rg = round(float(general_strength), 2)
|
| 428 |
rm = round(float(motion_strength), 2)
|
|
|
|
| 435 |
rv = round(float(voice_strength), 2)
|
| 436 |
re = round(float(realism_strength), 2)
|
| 437 |
rt = round(float(transition_strength), 2)
|
| 438 |
+
ry = round(float(physics_strength), 2)
|
| 439 |
+
ri = round(float(reasoning_strength), 2)
|
| 440 |
+
rw = round(float(twostep_strength), 2)
|
| 441 |
+
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}"
|
| 442 |
key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
|
| 443 |
return key, key_str
|
| 444 |
|
|
|
|
| 456 |
voice_strength: float,
|
| 457 |
realism_strength: float,
|
| 458 |
transition_strength: float,
|
| 459 |
+
physics_strength: float,
|
| 460 |
+
reasoning_strength: float,
|
| 461 |
+
twostep_strength: float,
|
| 462 |
progress=gr.Progress(track_tqdm=True),
|
| 463 |
):
|
| 464 |
"""
|
|
|
|
| 471 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 472 |
|
| 473 |
ledger = pipeline.model_ledger
|
| 474 |
+
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)
|
| 475 |
cache_path = LORA_CACHE_DIR / f"{key}.safetensors"
|
| 476 |
|
| 477 |
progress(0.05, desc="Preparing LoRA state")
|
|
|
|
| 499 |
(voice_lora_path, round(float(voice_strength), 2)),
|
| 500 |
(realism_lora_path, round(float(realism_strength), 2)),
|
| 501 |
(transition_lora_path, round(float(transition_strength), 2)),
|
| 502 |
+
(physics_lora_path, round(float(physics_strength), 2)),
|
| 503 |
+
(reasoning_lora_path, round(float(reasoning_strength), 2)),
|
| 504 |
+
(twostep_lora_path, round(float(twostep_strength), 2)),
|
| 505 |
]
|
| 506 |
loras_for_builder = [
|
| 507 |
LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)
|
|
|
|
| 704 |
voice_strength: float = 0.0,
|
| 705 |
realism_strength: float = 0.0,
|
| 706 |
transition_strength: float = 0.0,
|
| 707 |
+
physics_strength: float = 0.0,
|
| 708 |
+
reasoning_strength: float = 0.0,
|
| 709 |
+
twostep_strength: float = 0.0,
|
| 710 |
num_inference_steps: int = 8,
|
| 711 |
progress=None,
|
| 712 |
):
|
|
|
|
| 749 |
voice_strength: float = 0.0,
|
| 750 |
realism_strength: float = 0.0,
|
| 751 |
transition_strength: float = 0.0,
|
| 752 |
+
physics_strength: float = 0.0,
|
| 753 |
+
reasoning_strength: float = 0.0,
|
| 754 |
+
twostep_strength: float = 0.0,
|
| 755 |
num_inference_steps: int = 8,
|
| 756 |
progress=gr.Progress(track_tqdm=True),
|
| 757 |
):
|
|
|
|
| 989 |
|
| 990 |
with gr.Row():
|
| 991 |
transition_strength = gr.Slider(label="POV", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 992 |
+
physics_strength = gr.Slider(label="Physics", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 993 |
+
with gr.Row():
|
| 994 |
+
reasoning_strength = gr.Slider(label="Official Reasoning", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 995 |
+
twostep_strength = gr.Slider(label="Two Step Reasoning", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 996 |
|
| 997 |
prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")
|
| 998 |
lora_status = gr.Textbox(
|
|
|
|
| 1010 |
fn=prepare_lora_cache,
|
| 1011 |
inputs=[pose_strength, general_strength, motion_strength, dreamlay_strength,
|
| 1012 |
mself_strength, dramatic_strength, fluid_strength, liquid_strength,
|
| 1013 |
+
demopose_strength, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength, twostep_strength],
|
| 1014 |
outputs=[lora_status],
|
| 1015 |
)
|
| 1016 |
|
|
|
|
| 1024 |
pose_strength, general_strength, motion_strength,
|
| 1025 |
dreamlay_strength, mself_strength, dramatic_strength, fluid_strength,
|
| 1026 |
liquid_strength, demopose_strength, voice_strength, realism_strength,
|
| 1027 |
+
transition_strength, physics_strength, reasoning_strength, twostep_strength, num_inference_steps,
|
| 1028 |
],
|
| 1029 |
outputs=[output_video, seed],
|
| 1030 |
)
|