Update app.py
Browse files446 unmodified lines44744844945045145210 unmodified lines46346446546646746821 unmodified lines4904914924934944954964978 unmodified lines50650750850951051151251351451551651751820 unmodified lines53954054154254354454510 unmodified lines556557558559560561199 unmodified lines76176276376476576637 unmodified lines804805806807808809221 unmodified lines103110321033103410351036103736 unmodified lines10741075107610771078107910806 unmodified lines1087108810891090109110921093446 unmodified linesprint("Downloading LoRA adapters from dagloop5/LoRA...")print("=" * 80)pose_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_I2V_V3.safetensors")motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")dreamlay_lora_path = hf_hub_download(repo_id="lynaNSFW/DR34ML4Y_AIO_NSFW_LTX23", filename="DR34ML4Y_LTXXX_V2.safetensors") # m15510n4ry, bl0wj0b, d0ubl3_bj, d0gg1e, c0wg1rl10 unmodified linestwostep_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Multi_step_video_reasoning_V0.1.safetensors")print(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}")21 unmodified linesquantization=QuantizationPolicy.fp8_cast(),)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]:rp = round(float(pose_strength), 2)rg = round(float(general_strength), 2)rm = round(float(motion_strength), 2)rd = round(float(dreamlay_strength), 2)8 unmodified linesry = round(float(physics_strength), 2)ri = round(float(reasoning_strength), 2)rw = round(float(twostep_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}|{voice_lora_path}:{rv}|{realism_lora_path}:{re}|{transition_lora_path}:{rt}|{physics_lora_path}:{ry}|{reasoning_lora_path}:{ri}|{twostep_lora_path}:{rw}"key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()return key, key_strdef prepare_lora_cache(pose_strength: float,general_strength: float,motion_strength: float,dreamlay_strength: float,20 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, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength, twostep_strength)cache_path = LORA_CACHE_DIR / f"{key}.safetensors"progress(0.05, desc="Preparing LoRA state")10 unmodified linesentries = [(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)),199 unmodified linesaudio_rescale_scale: float = 1.0,audio_v2a_scale: float = 3.0,pose_strength: float = 0.0,general_strength: float = 0.0,motion_strength: float = 0.0,dreamlay_strength: float = 0.0,37 unmodified linesaudio_rescale_scale: float = 1.0,audio_v2a_scale: float = 3.0,pose_strength: float = 0.0,general_strength: float = 0.0,motion_strength: float = 0.0,dreamlay_strength: float = 0.0,221 unmodified lineswith gr.Row():pose_strength = gr.Slider(label="Anthro Enhancer", minimum=0.0, maximum=2.0, value=0.0, step=0.01)gr.Markdown("") # Spacer for alignmentwith gr.Row():general_strength = gr.Slider(label="Reasoning Enhancer", minimum=0.0, maximum=2.0, value=0.0, step=0.01)36 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, voice_strength, realism_strength, transition_strength, physics_strength, reasoning_strength, twostep_strength],outputs=[lora_status],6 unmodified linesenhance_prompt, seed, randomize_seed, height, width,video_cfg_scale, video_stg_scale, video_rescale_scale, video_a2v_scale,audio_cfg_scale, audio_stg_scale, audio_rescale_scale, audio_v2a_scale,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, num_inference_steps,446 unmodified lines44744844945045145245310 unmodified lines46446546646746846947021 unmodified lines4924934944954964974984995008 unmodified lines50951051151251351451551651751851952052152220 unmodified lines54354454554654754854910 unmodified lines560561562563564565566199 unmodified lines76676776876977077177237 unmodified lines810811812813814815816221 unmodified lines103810391040104110421043104436 unmodified lines10811082108310841085108610876 unmodified lines1094109510961097109810991100446 unmodified linesprint("Downloading LoRA adapters from dagloop5/LoRA...")print("=" * 80)pose_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2_3_NSFW_furry_concat_v2.safetensors")twod_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_2d_NSFW_motion_enhancer.safetensors") # 2d style animationgeneral_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_reasoning_I2V_V3.safetensors")motion_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="motion_helper.safetensors")dreamlay_lora_path = hf_hub_download(repo_id="lynaNSFW/DR34ML4Y_AIO_NSFW_LTX23", filename="DR34ML4Y_LTXXX_V2.safetensors") # m15510n4ry, bl0wj0b, d0ubl3_bj, d0gg1e, c0wg1rl10 unmodified linestwostep_lora_path = hf_hub_download(repo_id=LORA_REPO, filename="LTX2.3_Multi_step_video_reasoning_V0.1.safetensors")print(f"Pose LoRA: {pose_lora_path}")print(f"twod LoRA: {twod_lora_path}")print(f"General LoRA: {general_lora_path}")print(f"Motion LoRA: {motion_lora_path}")print(f"Dreamlay LoRA: {dreamlay_lora_path}")21 unmodified linesquantization=QuantizationPolicy.fp8_cast(),)def _make_lora_key(pose_strength: float, twod_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]:rp = round(float(pose_strength), 2)ra = round(float(twod_strength), 2)rg = round(float(general_strength), 2)rm = round(float(motion_strength), 2)rd = round(float(dreamlay_strength), 2)8 unmodified linesry = round(float(physics_strength), 2)ri = round(float(reasoning_strength), 2)rw = round(float(twostep_strength), 2)key_str = f"{pose_lora_path}:{rp}|{twod_lora_path}:{ra}|{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}"key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()return key, key_strdef prepare_lora_cache(pose_strength: float,twod_strength: float,general_strength: float,motion_strength: float,dreamlay_strength: float,20 unmodified linesglobal PENDING_LORA_KEY, PENDING_LORA_STATE, PENDING_LORA_STATUSledger = pipeline.model_ledgerkey, _ = _make_lora_key(pose_strength, twod_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)cache_path = LORA_CACHE_DIR / f"{key}.safetensors"progress(0.05, desc="Preparing LoRA state")10 unmodified linesentries = [(pose_lora_path, round(float(pose_strength), 2)),(twod_lora_path, round(float(twod_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)),199 unmodified linesaudio_rescale_scale: float = 1.0,audio_v2a_scale: float = 3.0,pose_strength: float = 0.0,twod_strength: float = 0.0,general_strength: float = 0.0,motion_strength: float = 0.0,dreamlay_strength: float = 0.0,37 unmodified linesaudio_rescale_scale: float = 1.0,audio_v2a_scale: float = 3.0,pose_strength: float = 0.0,twod_strength: float = 0.0,general_strength: float = 0.0,motion_strength: float = 0.0,dreamlay_strength: float = 0.0,221 unmodified lineswith gr.Row():pose_strength = gr.Slider(label="Anthro Enhancer", minimum=0.0, maximum=2.0, value=0.0, step=0.01)twod_strength = gr.Slider(label="2D Enhancer", minimum=0.0, maximum=2.0, value=0.0, step=0.01)with gr.Row():general_strength = gr.Slider(label="Reasoning Enhancer", minimum=0.0, maximum=2.0, value=0.0, step=0.01)36 unmodified linesprepare_lora_btn.click(fn=prepare_lora_cache,inputs=[pose_strength, twod_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],outputs=[lora_status],6 unmodified linesenhance_prompt, seed, randomize_seed, height, width,video_cfg_scale, video_stg_scale, video_rescale_scale, video_a2v_scale,audio_cfg_scale, audio_stg_scale, audio_rescale_scale, audio_v2a_scale,pose_strength, twod_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, num_inference_steps,
app.py+13-6