Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -299,7 +299,7 @@ print("Downloading LoRA adapters from dagloop5/LoRA...")
|
|
| 299 |
print("=" * 80)
|
| 300 |
paste_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="ltx23-kabapaste.safetensors")
|
| 301 |
ruri_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX23-ruri.safetensors")
|
| 302 |
-
|
| 303 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 304 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Reasoning_V1.safetensors")
|
| 305 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
|
@@ -313,7 +313,7 @@ sulphur_lora_path = hf_hub_download(repo_id="SulphurAI/Sulphur-2-base", filename
|
|
| 313 |
|
| 314 |
print(f"Paste LoRA: {paste_lora_path }")
|
| 315 |
print(f"Ruri LoRA: {ruri_lora_path }")
|
| 316 |
-
print(f"
|
| 317 |
print(f"Pose LoRA: {pose_lora_path}")
|
| 318 |
print(f"General LoRA: {general_lora_path}")
|
| 319 |
print(f"Motion LoRA: {motion_lora_path}")
|
|
@@ -341,10 +341,10 @@ pipeline = LTX23DistilledA2VPipeline(
|
|
| 341 |
)
|
| 342 |
# ----------------------------------------------------------------
|
| 343 |
|
| 344 |
-
def _make_lora_key(paste_strength: float,ruri_strength: float,
|
| 345 |
ps = round(float(paste_strength), 2)
|
| 346 |
rr = round(float(ruri_strength), 2)
|
| 347 |
-
rt = round(float(
|
| 348 |
rp = round(float(pose_strength), 2)
|
| 349 |
rg = round(float(general_strength), 2)
|
| 350 |
rm = round(float(motion_strength), 2)
|
|
@@ -355,7 +355,7 @@ def _make_lora_key(paste_strength: float,ruri_strength: float,transit_strength:
|
|
| 355 |
rl = round(float(liquid_strength), 2)
|
| 356 |
ro = round(float(demopose_strength), 2)
|
| 357 |
ss = round(float(sulphur_strength), 2)
|
| 358 |
-
key_str = f"{paste_lora_path}:{ps}|{ruri_lora_path}:{rr}|{
|
| 359 |
key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
|
| 360 |
return key, key_str
|
| 361 |
|
|
@@ -363,7 +363,7 @@ def _make_lora_key(paste_strength: float,ruri_strength: float,transit_strength:
|
|
| 363 |
def prepare_lora_cache(
|
| 364 |
paste_strength: float,
|
| 365 |
ruri_strength: float,
|
| 366 |
-
|
| 367 |
pose_strength: float,
|
| 368 |
general_strength: float,
|
| 369 |
motion_strength: float,
|
|
@@ -386,7 +386,7 @@ def prepare_lora_cache(
|
|
| 386 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 387 |
|
| 388 |
ledger = pipeline.model_ledger
|
| 389 |
-
key, _ = _make_lora_key(paste_strength,ruri_strength,
|
| 390 |
cache_path = LORA_CACHE_DIR / f"{key}.pt"
|
| 391 |
|
| 392 |
progress(0.05, desc="Preparing LoRA state")
|
|
@@ -404,7 +404,7 @@ def prepare_lora_cache(
|
|
| 404 |
entries = [
|
| 405 |
(paste_lora_path, round(float(paste_strength), 2)),
|
| 406 |
(ruri_lora_path, round(float(ruri_strength), 2)),
|
| 407 |
-
(
|
| 408 |
(pose_lora_path, round(float(pose_strength), 2)),
|
| 409 |
(general_lora_path, round(float(general_strength), 2)),
|
| 410 |
(motion_lora_path, round(float(motion_strength), 2)),
|
|
@@ -603,7 +603,7 @@ def get_gpu_duration(
|
|
| 603 |
width: int = 1536,
|
| 604 |
paste_strength: float = 0.0,
|
| 605 |
ruri_strength: float = 0.0,
|
| 606 |
-
|
| 607 |
pose_strength: float = 0.0,
|
| 608 |
general_strength: float = 0.0,
|
| 609 |
motion_strength: float = 0.0,
|
|
@@ -634,7 +634,7 @@ def generate_video(
|
|
| 634 |
width: int = 1536,
|
| 635 |
paste_strength: float = 0.0,
|
| 636 |
ruri_strength: float = 0.0,
|
| 637 |
-
|
| 638 |
pose_strength: float = 0.0,
|
| 639 |
general_strength: float = 0.0,
|
| 640 |
motion_strength: float = 0.0,
|
|
@@ -753,7 +753,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 753 |
gr.Markdown("### LoRA adapter strengths (set to 0 to disable)")
|
| 754 |
paste_strength = gr.Slider(label="Paste anything Lora strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 755 |
ruri_strength = gr.Slider(label="Ruri lady Lora strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 756 |
-
|
| 757 |
pose_strength = gr.Slider(label="Anthro Enhancer strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 758 |
general_strength = gr.Slider(label="Reasoning Enhancer strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 759 |
motion_strength = gr.Slider(label="Anthro Posing Helper strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
|
@@ -851,7 +851,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 851 |
|
| 852 |
prepare_lora_btn.click(
|
| 853 |
fn=prepare_lora_cache,
|
| 854 |
-
inputs=[paste_strength, ruri_strength,
|
| 855 |
outputs=[lora_status],
|
| 856 |
)
|
| 857 |
|
|
@@ -860,7 +860,7 @@ with gr.Blocks(title="LTX-2.3 Distilled") as demo:
|
|
| 860 |
inputs=[
|
| 861 |
first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
|
| 862 |
seed, randomize_seed, height, width,
|
| 863 |
-
paste_strength, ruri_strength,
|
| 864 |
],
|
| 865 |
outputs=[output_video, seed],
|
| 866 |
)
|
|
|
|
| 299 |
print("=" * 80)
|
| 300 |
paste_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="ltx23-kabapaste.safetensors")
|
| 301 |
ruri_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX23-ruri.safetensors")
|
| 302 |
+
popping_lora_path = hf_hub_download(repo_id="YuLexuan30/Balloon_popping", filename="poppedv2ltx23.safetensors")
|
| 303 |
pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")
|
| 304 |
general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Reasoning_V1.safetensors")
|
| 305 |
motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")
|
|
|
|
| 313 |
|
| 314 |
print(f"Paste LoRA: {paste_lora_path }")
|
| 315 |
print(f"Ruri LoRA: {ruri_lora_path }")
|
| 316 |
+
print(f"Popping LoRA: {popping_lora_path }")
|
| 317 |
print(f"Pose LoRA: {pose_lora_path}")
|
| 318 |
print(f"General LoRA: {general_lora_path}")
|
| 319 |
print(f"Motion LoRA: {motion_lora_path}")
|
|
|
|
| 341 |
)
|
| 342 |
# ----------------------------------------------------------------
|
| 343 |
|
| 344 |
+
def _make_lora_key(paste_strength: float,ruri_strength: float,popping_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, sulphur_strength: float) -> tuple[str, str]:
|
| 345 |
ps = round(float(paste_strength), 2)
|
| 346 |
rr = round(float(ruri_strength), 2)
|
| 347 |
+
rt = round(float(popping_strength), 2)
|
| 348 |
rp = round(float(pose_strength), 2)
|
| 349 |
rg = round(float(general_strength), 2)
|
| 350 |
rm = round(float(motion_strength), 2)
|
|
|
|
| 355 |
rl = round(float(liquid_strength), 2)
|
| 356 |
ro = round(float(demopose_strength), 2)
|
| 357 |
ss = round(float(sulphur_strength), 2)
|
| 358 |
+
key_str = f"{paste_lora_path}:{ps}|{ruri_lora_path}:{rr}|{popping_lora_path}:{rt}|{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}|{sulphur_lora_path}:{ss}"
|
| 359 |
key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
|
| 360 |
return key, key_str
|
| 361 |
|
|
|
|
| 363 |
def prepare_lora_cache(
|
| 364 |
paste_strength: float,
|
| 365 |
ruri_strength: float,
|
| 366 |
+
popping_strength: float,
|
| 367 |
pose_strength: float,
|
| 368 |
general_strength: float,
|
| 369 |
motion_strength: float,
|
|
|
|
| 386 |
global PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUS
|
| 387 |
|
| 388 |
ledger = pipeline.model_ledger
|
| 389 |
+
key, _ = _make_lora_key(paste_strength,ruri_strength,popping_strength,pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, sulphur_strength)
|
| 390 |
cache_path = LORA_CACHE_DIR / f"{key}.pt"
|
| 391 |
|
| 392 |
progress(0.05, desc="Preparing LoRA state")
|
|
|
|
| 404 |
entries = [
|
| 405 |
(paste_lora_path, round(float(paste_strength), 2)),
|
| 406 |
(ruri_lora_path, round(float(ruri_strength), 2)),
|
| 407 |
+
(popping_lora_path, round(float(popping_strength), 2)),
|
| 408 |
(pose_lora_path, round(float(pose_strength), 2)),
|
| 409 |
(general_lora_path, round(float(general_strength), 2)),
|
| 410 |
(motion_lora_path, round(float(motion_strength), 2)),
|
|
|
|
| 603 |
width: int = 1536,
|
| 604 |
paste_strength: float = 0.0,
|
| 605 |
ruri_strength: float = 0.0,
|
| 606 |
+
popping_strength: float = 0.0,
|
| 607 |
pose_strength: float = 0.0,
|
| 608 |
general_strength: float = 0.0,
|
| 609 |
motion_strength: float = 0.0,
|
|
|
|
| 634 |
width: int = 1536,
|
| 635 |
paste_strength: float = 0.0,
|
| 636 |
ruri_strength: float = 0.0,
|
| 637 |
+
popping_strength: float = 0.0,
|
| 638 |
pose_strength: float = 0.0,
|
| 639 |
general_strength: float = 0.0,
|
| 640 |
motion_strength: float = 0.0,
|
|
|
|
| 753 |
gr.Markdown("### LoRA adapter strengths (set to 0 to disable)")
|
| 754 |
paste_strength = gr.Slider(label="Paste anything Lora strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 755 |
ruri_strength = gr.Slider(label="Ruri lady Lora strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 756 |
+
popping_strength = gr.Slider(label="Balloon popping Lora strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 757 |
pose_strength = gr.Slider(label="Anthro Enhancer strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 758 |
general_strength = gr.Slider(label="Reasoning Enhancer strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
| 759 |
motion_strength = gr.Slider(label="Anthro Posing Helper strength", minimum=0.0, maximum=2.0, value=0.0, step=0.01)
|
|
|
|
| 851 |
|
| 852 |
prepare_lora_btn.click(
|
| 853 |
fn=prepare_lora_cache,
|
| 854 |
+
inputs=[paste_strength, ruri_strength, popping_strength, pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, sulphur_strength],
|
| 855 |
outputs=[lora_status],
|
| 856 |
)
|
| 857 |
|
|
|
|
| 860 |
inputs=[
|
| 861 |
first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,
|
| 862 |
seed, randomize_seed, height, width,
|
| 863 |
+
paste_strength, ruri_strength, popping_strength, pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength, sulphur_strength,
|
| 864 |
],
|
| 865 |
outputs=[output_video, seed],
|
| 866 |
)
|