Spaces:
Running on Zero
Running on Zero
Transtion lora add
Browse files
app.py
CHANGED
|
@@ -297,6 +297,8 @@ LORA_REPO = "dagloop5/LoRA"
|
|
| 297 |
print("=" * 80)
|
| 298 |
print("Downloading LoRA adapters from dagloop5/LoRA...")
|
| 299 |
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")
|
|
@@ -307,6 +309,8 @@ fluid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="cr3ampi3_animatio
|
|
| 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}")
|
|
@@ -334,6 +338,7 @@ pipeline = LTX23DistilledA2VPipeline(
|
|
| 334 |
# ----------------------------------------------------------------
|
| 335 |
|
| 336 |
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]:
|
|
|
|
| 337 |
rp = round(float(pose_strength), 2)
|
| 338 |
rg = round(float(general_strength), 2)
|
| 339 |
rm = round(float(motion_strength), 2)
|
|
@@ -349,6 +354,7 @@ def _make_lora_key(pose_strength: float, general_strength: float, motion_strengt
|
|
| 349 |
|
| 350 |
|
| 351 |
def prepare_lora_cache(
|
|
|
|
| 352 |
pose_strength: float,
|
| 353 |
general_strength: float,
|
| 354 |
motion_strength: float,
|
|
@@ -370,7 +376,7 @@ def prepare_lora_cache(
|
|
| 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")
|
|
@@ -386,6 +392,7 @@ def prepare_lora_cache(
|
|
| 386 |
print(f"[LoRA] Cache load failed: {type(e).__name__}: {e}")
|
| 387 |
|
| 388 |
entries = [
|
|
|
|
| 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)),
|
|
@@ -725,6 +732,10 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 725 |
high_res = gr.Checkbox(label="High Resolution", value=True)
|
| 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
|
|
@@ -835,7 +846,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 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,7 +855,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 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 |
)
|
|
|
|
| 297 |
print("=" * 80)
|
| 298 |
print("Downloading LoRA adapters from dagloop5/LoRA...")
|
| 299 |
print("=" * 80)
|
| 300 |
+
|
| 301 |
+
transit_lora_path = hf_hub_download(repo_id="valiantcat", filename="LTX-2.3-Transition-LORA")
|
| 302 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 303 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Reasoning_V1.safetensors")
|
| 304 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
|
|
|
| 309 |
liquid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="liquid_wet_dr1pp_ltx2_v1.0_scaled.safetensors") # wet dr1pp
|
| 310 |
demopose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="ltx23__demopose_d3m0p0s3.safetensors") # d3m0p0s3
|
| 311 |
|
| 312 |
+
|
| 313 |
+
print(f"Transit LoRA: {transit_lora_path }")
|
| 314 |
print(f"Pose LoRA: {pose_lora_path}")
|
| 315 |
print(f"General LoRA: {general_lora_path}")
|
| 316 |
print(f"Motion LoRA: {motion_lora_path}")
|
|
|
|
| 338 |
# ----------------------------------------------------------------
|
| 339 |
|
| 340 |
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]:
|
| 341 |
+
rt = round(float(transit_strength), 2)
|
| 342 |
rp = round(float(pose_strength), 2)
|
| 343 |
rg = round(float(general_strength), 2)
|
| 344 |
rm = round(float(motion_strength), 2)
|
|
|
|
| 354 |
|
| 355 |
|
| 356 |
def prepare_lora_cache(
|
| 357 |
+
transit_strength: float,
|
| 358 |
pose_strength: float,
|
| 359 |
general_strength: float,
|
| 360 |
motion_strength: float,
|
|
|
|
| 376 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 377 |
|
| 378 |
ledger = pipeline.model_ledger
|
| 379 |
+
key, _ = _make_lora_key(transit_strength,pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength)
|
| 380 |
cache_path = LORA_CACHE_DIR / f"{key}.pt"
|
| 381 |
|
| 382 |
progress(0.05, desc="Preparing LoRA state")
|
|
|
|
| 392 |
print(f"[LoRA] Cache load failed: {type(e).__name__}: {e}")
|
| 393 |
|
| 394 |
entries = [
|
| 395 |
+
(transit_lora_path, round(float(transit_strength), 2)),
|
| 396 |
(pose_lora_path, round(float(pose_strength), 2)),
|
| 397 |
(general_lora_path, round(float(general_strength), 2)),
|
| 398 |
(motion_lora_path, round(float(motion_strength), 2)),
|
|
|
|
| 732 |
high_res = gr.Checkbox(label="High Resolution", value=True)
|
| 733 |
with gr.Column():
|
| 734 |
gr.Markdown("### LoRA adapter strengths (set to 0 to disable)")
|
| 735 |
+
transit_strength = gr.Slider(
|
| 736 |
+
label="Transition Lora strength",
|
| 737 |
+
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
| 738 |
+
)
|
| 739 |
pose_strength = gr.Slider(
|
| 740 |
label="Anthro Enhancer strength",
|
| 741 |
minimum=0.0, maximum=2.0, value=0.0, step=0.01
|
|
|
|
| 846 |
|
| 847 |
prepare_lora_btn.click(
|
| 848 |
fn=prepare_lora_cache,
|
| 849 |
+
inputs=[transit_strength, pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength],
|
| 850 |
outputs=[lora_status],
|
| 851 |
)
|
| 852 |
|
|
|
|
| 855 |
inputs=[
|
| 856 |
first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
|
| 857 |
seed, randomize_seed, height, width,
|
| 858 |
+
transit_strength,pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength,
|
| 859 |
],
|
| 860 |
outputs=[output_video, seed],
|
| 861 |
)
|