Spaces:
Paused
Paused
Update app.py
Browse files299 unmodified lines30030130230330430530630730830911 unmodified lines3213223233243253263273283293303312 unmodified lines3343353363373383396 unmodified lines34634734834935035135212 unmodified lines365366367368369370183 unmodified lines55455555655755855915 unmodified lines57557657757857958069 unmodified lines65065165265365465565665726 unmodified lines68468568668768868969069169269369469569669769835 unmodified lines73473573673773873974074174274374474517 unmodified lines7637647657667677687692 unmodified lines772773774775776777778299 unmodified linespose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Reasoning_V1.safetensors")motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")print(f"Pose LoRA: {pose_lora_path}")print(f"General LoRA: {general_lora_path}")print(f"Motion LoRA: {motion_lora_path}")# ----------------------------------------------------------------print(f"Checkpoint: {checkpoint_path}")11 unmodified lines)# ----------------------------------------------------------------def _make_lora_key(pose_strength: float, general_strength: float, motion_strength: float) -> tuple[str, str]:rp = round(float(pose_strength), 2)rg = round(float(general_strength), 2)rm = round(float(motion_strength), 2)key_str = f"{pose_lora_path}:{rp}|{general_lora_path}:{rg}|{motion_lora_path}:{rm}"key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()return key, key_str2 unmodified linespose_strength: float,general_strength: float,motion_strength: float,progress=gr.Progress(track_tqdm=True),):"""6 unmodified linesglobal PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUSledger = pipeline.model_ledgerkey, _ = _make_lora_key(pose_strength, general_strength, motion_strength)cache_path = LORA_CACHE_DIR / f"{key}.pt"progress(0.05, desc="Preparing LoRA state")12 unmodified lines(pose_lora_path, round(float(pose_strength), 2)),(general_lora_path, round(float(general_strength), 2)),(motion_lora_path, round(float(motion_strength), 2)),]loras_for_builder = [LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)183 unmodified linespose_strength: float = 0.0,general_strength: float = 0.0,motion_strength: float = 0.0,progress=None,):return int(gpu_duration)15 unmodified linespose_strength: float = 0.0,general_strength: float = 0.0,motion_strength: float = 0.0,progress=gr.Progress(track_tqdm=True),):try:69 unmodified linesreturn None, current_seedwith gr.Blocks(title="LTX-2.3 Heretic Distilled") as demo:gr.Markdown("# LTX-2.3 F2LF:Heretic with Fast Audio-Video Generation with Frame Conditioning")with gr.Row():26 unmodified lineswith gr.Column():gr.Markdown("### LoRA adapter strengths (set to 0 to disable)")pose_strength = gr.Slider(label="Pose Enhancer strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)general_strength = gr.Slider(label="General Enhancer strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)motion_strength = gr.Slider(label="Motion Helper strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")35 unmodified lines0.0, # pose_strength (example)0.0, # general_strength (example)0.0, # motion_strength (example)],],inputs=[first_image, last_image, input_audio, prompt, duration, gpu_duration,enhance_prompt, seed, randomize_seed, height, width,pose_strength, general_strength, motion_strength,],)17 unmodified linesprepare_lora_btn.click(fn=prepare_lora_cache,inputs=[pose_strength, general_strength, motion_strength],outputs=[lora_status],)2 unmodified linesinputs=[first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,seed, randomize_seed, height, width,pose_strength, general_strength, motion_strength,],outputs=[output_video, seed],)299 unmodified lines30030130230330430530630730830931031131231331431531631731831932032111 unmodified lines3333343353363373383393403413423433443453463473483492 unmodified lines3523533543553563573583593603613623636 unmodified lines37037137237337437537612 unmodified lines389390391392393394395396397398399400183 unmodified lines58458558658758858959059159259359459515 unmodified lines61161261361461561661761861962062162269 unmodified lines69269369469569669769869926 unmodified lines72672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376435 unmodified lines80080180280380480580680780880981081181281381481581681717 unmodified lines8358368378388398408412 unmodified lines844845846847848849850299 unmodified linespose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")general_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Reasoning_V1.safetensors")motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")dreamlay_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="DR34ML4Y_LTXXX_PREVIEW_RC1.safetensors") # m15510n4ry, bl0wj0b, d0ubl3_bj, d0gg1e, c0wg1rlmself_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="Furry Hyper Masturbation - LTX-2 I2V v1.safetensors") # Hyperfapdramatic_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX-2.3 - Orgasm.safetensors") # "[He | She] is having am orgasm." (am or an?)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 animationliquid_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="liquid_wet_dr1pp_ltx2_v1.0_scaled.safetensors") # wet dr1ppdemopose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="ltx23__demopose_d3m0p0s3.safetensors") # d3m0p0s3print(f"Pose LoRA: {pose_lora_path}")print(f"General LoRA: {general_lora_path}")print(f"Motion LoRA: {motion_lora_path}")print(f"Dreamlay LoRA: {dreamlay_lora_path}")print(f"Mself LoRA: {mself_lora_path}")print(f"Dramatic LoRA: {dramatic_lora_path}")print(f"Fluid LoRA: {fluid_lora_path}")print(f"Liquid LoRA: {liquid_lora_path}")print(f"Demopose LoRA: {demopose_lora_path}")# ----------------------------------------------------------------print(f"Checkpoint: {checkpoint_path}")11 unmodified lines)# ----------------------------------------------------------------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]:rp = round(float(pose_strength), 2)rg = round(float(general_strength), 2)rm = round(float(motion_strength), 2)rd = round(float(dreamlay_strength), 2)rs = round(float(mself_strength), 2)rr = round(float(dramatic_strength), 2)rf = round(float(fluid_strength), 2)rl = round(float(liquid_strength), 2)ro = round(float(demopose_strength), 2)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}"key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()return key, key_str2 unmodified linespose_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,progress=gr.Progress(track_tqdm=True),):"""6 unmodified linesglobal PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUSledger = pipeline.model_ledgerkey, _ = _make_lora_key(pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength)cache_path = LORA_CACHE_DIR / f"{key}.pt"progress(0.05, desc="Preparing LoRA state")12 unmodified lines(pose_lora_path, round(float(pose_strength), 2)),(general_lora_path, round(float(general_strength), 2)),(motion_lora_path, round(float(motion_strength), 2)),(dreamlay_lora_path, round(float(dreamlay_strength), 2)),(mself_lora_path, round(float(mself_strength), 2)),(dramatic_lora_path, round(float(dramatic_strength), 2)),(fluid_lora_path, round(float(fluid_strength), 2)),(liquid_lora_path, round(float(liquid_strength), 2)),(demopose_lora_path, round(float(demopose_strength), 2)),]loras_for_builder = [LoraPathStrengthAndSDOps(path, strength, LTXV_LORA_COMFY_RENAMING_MAP)183 unmodified linespose_strength: float = 0.0,general_strength: float = 0.0,motion_strength: float = 0.0,dreamlay_strength: float = 0.0,mself_strength: float = 0.0,dramatic_strength: float = 0.0,fluid_strength: float = 0.0,liquid_strength: float = 0.0,demopose_strength: float = 0.0,progress=None,):return int(gpu_duration)15 unmodified linespose_strength: float = 0.0,general_strength: float = 0.0,motion_strength: float = 0.0,dreamlay_strength: float = 0.0,mself_strength: float = 0.0,dramatic_strength: float = 0.0,fluid_strength: float = 0.0,liquid_strength: float = 0.0,demopose_strength: float = 0.0,progress=gr.Progress(track_tqdm=True),):try:69 unmodified linesreturn None, current_seedwith gr.Blocks(title="LTX-2.3 Distilled") as demo:gr.Markdown("# LTX-2.3 F2LF with Fast Audio-Video Generation with Frame Conditioning")with gr.Row():26 unmodified lineswith gr.Column():gr.Markdown("### LoRA adapter strengths (set to 0 to disable)")pose_strength = gr.Slider(label="Anthro Enhancer strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)general_strength = gr.Slider(label="Reasoning Enhancer strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)motion_strength = gr.Slider(label="Anthro Posing Helper strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)motion_strength = gr.Slider(label="Dreamlay strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)motion_strength = gr.Slider(label="Mself strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)motion_strength = gr.Slider(label="Dramatic strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)motion_strength = gr.Slider(label="Fluid Helper strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)motion_strength = gr.Slider(label="Liquid Helper strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)motion_strength = gr.Slider(label="Demopose Helper strength",minimum=0.0, maximum=2.0, value=0.0, step=0.01)prepare_lora_btn = gr.Button("Prepare / Load LoRA Cache", variant="secondary")35 unmodified lines0.0, # pose_strength (example)0.0, # general_strength (example)0.0, # motion_strength (example)0.0,0.0,0.0,0.0,0.0,0.0,],],inputs=[first_image, last_image, input_audio, prompt, duration, gpu_duration,enhance_prompt, seed, randomize_seed, height, width,pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength,],)17 unmodified linesprepare_lora_btn.click(fn=prepare_lora_cache,inputs=[pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength],outputs=[lora_status],)2 unmodified linesinputs=[first_image, last_image, input_audio, prompt, duration, gpu_duration, enhance_prompt,seed, randomize_seed, height, width,pose_strength, general_strength, motion_strength, dreamlay_strength, mself_strength, dramatic_strength, fluid_strength, liquid_strength, demopose_strength,],outputs=[output_video, seed],)
app.py+83-11