Upload app.py
Browse files41 unmodified lines424344454647484950515253454647357 unmodified lines40540640741741841942042142242340840941035 unmodified lines446447448465466449450451452453404 unmodified lines85885986087786141 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 lines
def 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 lines lora_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. # 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]) demo.launch(show_error=True, theme=gr.themes.Citrus(), css=CSS, allowed_paths=[OUTPUT_DIR])app.py+3-19