Upload app.py
Browse files41 unmodified lines424344454647484950515253545556357 unmodified lines41441541641741841942042142242342442542635 unmodified lines462463464465466467468469404 unmodified lines87487587687741 unmodified linesLORA_FILE = os.environ.get("H3_LORA_FILE", "minimax_h3_4step_lora_flashgen_v1.0_768p_bf16.safetensors")# Additional LoRAs, merged on top of the FlashGen 4-step weights.MOTION_LORA_REPO = os.environ.get("H3_MOTION_LORA_REPO","rzgar/minimax-h3_fl2v_8Step_motion_enhancer",)MOTION_LORA_FILE = os.environ.get("H3_MOTION_LORA_FILE","minimax-h3_fl2v_8Step_motion_enhancer.safetensors",)MOTION_LORA_SCALE = float(os.environ.get("H3_MOTION_LORA_SCALE", "1.0"))HMCUMSHOT_REPO = os.environ.get("H3_HMCUMSHOT_REPO", "Hearmeman/minimax-h3-loras")HMCUMSHOT_FILE = os.environ.get("H3_HMCUMSHOT_FILE", "HMCumshot_V1.0.safetensors")357 unmodified linesdef load_and_apply_extra_loras(transformer) -> list[str]:return [_apply_extra_lora(transformer,MOTION_LORA_REPO,MOTION_LORA_FILE,"Motion Enhancer LoRA",MOTION_LORA_SCALE,),_apply_extra_lora(transformer,HMCUMSHOT_REPO,35 unmodified lineslora_status = load_and_apply_lora(pipe.transformer)print(f"[gen] {lora_status}", flush=True)# Then fold the requested Motion Enhancer and HMCumshot LoRAs into the# same transformer. They add their deltas on top of FlashGen.for extra_status in load_and_apply_extra_loras(pipe.transformer):print(f"[gen] {extra_status}", flush=True)404 unmodified linesload_models()if __name__ == "__main__":demo.launch(show_error=True, theme=gr.themes.Citrus(), css=CSS, allowed_paths=[OUTPUT_DIR])41 unmodified lines424344454647357 unmodified lines40540640740840941035 unmodified lines446447448449450451452453404 unmodified lines85885986086141 unmodified linesLORA_FILE = os.environ.get("H3_LORA_FILE", "minimax_h3_4step_lora_flashgen_v1.0_768p_bf16.safetensors")# Additional LoRAs, merged on top of the FlashGen 4-step weights.HMCUMSHOT_REPO = os.environ.get("H3_HMCUMSHOT_REPO", "Hearmeman/minimax-h3-loras")HMCUMSHOT_FILE = os.environ.get("H3_HMCUMSHOT_FILE", "HMCumshot_V1.0.safetensors")357 unmodified linesdef load_and_apply_extra_loras(transformer) -> list[str]:return [_apply_extra_lora(transformer,HMCUMSHOT_REPO,35 unmodified lineslora_status = load_and_apply_lora(pipe.transformer)print(f"[gen] {lora_status}", flush=True)# Then fold the requested HMCumshot LoRA into the same transformer.# It adds its delta on top of FlashGen.for extra_status in load_and_apply_extra_loras(pipe.transformer):print(f"[gen] {extra_status}", flush=True)404 unmodified linesload_models()if __name__ == "__main__":demo.launch(show_error=True, theme=gr.themes.Citrus(), css=CSS, allowed_paths=[OUTPUT_DIR])
app.py+3-19