Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files423 unmodified lines42442542642742842948 unmodified lines4784794804814824834847 unmodified lines49249349449549649749849950050150250350450550616 unmodified lines523524525526527528529423 unmodified linesexcept Exception as e:# Defensive: if the descriptor isn't present, continue quietlyprint(f"[LoRA] could not set strength: {e}")log_memory("before pipeline call")48 unmodified lineslines=3,placeholder="Describe the motion and animation you want...",)duration = gr.Slider(label="Duration (seconds)", minimum=1.0, maximum=10.0, value=3.0, step=0.1)generate_btn = gr.Button("Generate Video", variant="primary", size="lg")7 unmodified lineswith gr.Row():enhance_prompt = gr.Checkbox(label="Enhance Prompt", value=False)high_res = gr.Checkbox(label="High Resolution", value=True)# >>> ADD this line inside the Advanced Settings (e.g., after randomize_seed)lora_strength = gr.Slider(label="LoRA Strength",info="Scale for the LoRA weights (0.0 = off). Set near 1.0 for full effect.",minimum=0.0,maximum=1.5,value=1.0,step=0.01,)with gr.Column():output_video = gr.Video(label="Generated Video", autoplay=False)16 unmodified linesTrue,1024,1024,1,],],inputs=[423 unmodified lines42442542642742842943043143243343443543643743848 unmodified lines4874884894904914924937 unmodified lines50150250350450550650750850951051151251351451551616 unmodified lines533534535536537538539423 unmodified linesexcept Exception as e:# Defensive: if the descriptor isn't present, continue quietlyprint(f"[LoRA] could not set strength: {e}")# >>> FORCE transformer rebuild so LoRA strength updatestry:# Clear cached transformer so new LoRA strength is appliedif hasattr(pipeline.model_ledger, "_transformer"):pipeline.model_ledger._transformer = Noneprint("[LoRA] transformer cache cleared")except Exception as e:print(f"[LoRA] transformer reset failed: {e}")log_memory("before pipeline call")48 unmodified lineslines=3,placeholder="Describe the motion and animation you want...",)duration = gr.Slider(label="Duration (seconds)", minimum=1.0, maximum=30.0, value=10.0, step=0.1)generate_btn = gr.Button("Generate Video", variant="primary", size="lg")7 unmodified lineswith gr.Row():enhance_prompt = gr.Checkbox(label="Enhance Prompt", value=False)high_res = gr.Checkbox(label="High Resolution", value=True)# >>> MOVE slider OUTSIDE the rowlora_strength = gr.Slider(label="LoRA Strength",info="Scale for the LoRA weights (0.0 = off). Set near 1.0 for full effect.",minimum=0.0,maximum=2.0,value=1.0,step=0.01,)with gr.Column():output_video = gr.Video(label="Generated Video", autoplay=False)16 unmodified linesTrue,1024,1024,1.0,],],inputs=[
app.py+21-11