Spaces:
Paused
Paused
Update app.py
Browse files9 unmodified lines10111213141528 unmodified lines44454647484911 unmodified lines616263646566232 unmodified lines2993003013023033043053063073083099 unmodified linesimport randomimport gcimport copyfrom torchao.quantization import quantize_from torchao.quantization import Float8DynamicActivationFloat8WeightConfig28 unmodified linesMIN_DURATION = round(MIN_FRAMES_MODEL / FIXED_FPS, 1)MAX_DURATION = round(MAX_FRAMES_MODEL / FIXED_FPS, 1)SCHEDULER_MAP = {"FlowMatchEulerDiscrete": FlowMatchEulerDiscreteScheduler,"SASolver": SASolverScheduler,11 unmodified linesoriginal_scheduler = copy.deepcopy(pipe.scheduler)print(original_scheduler)quantize_(pipe.text_encoder, Int8WeightOnlyConfig())quantize_(pipe.transformer, Float8DynamicActivationFloat8WeightConfig())quantize_(pipe.transformer_2, Float8DynamicActivationFloat8WeightConfig())232 unmodified linesreturn video_path, video_path, current_seedwith gr.Blocks(theme=gr.themes.Soft(), delete_cache=(12800, 12800)) as demo:gr.Markdown("# WAMU V2 - Wan 2.2 I2V (14B) 🐢")gr.Markdown("## ℹ️ **A Note on Performance:** This version prioritizes a straightforward setup over maximum speed, so performance may vary.")gr.Markdown('Try the previous version: [WAMU v1](https://huggingface.co/spaces/r3gm/wan2-2-fp8da-aoti-preview2)')gr.Markdown("run Wan 2.2 in just 4-8 steps, fp8 quantization & AoT compilation - compatible with 🧨 diffusers and ZeroGPU")with gr.Row():with gr.Column():input_image_component = gr.Image(type="pil", label="Input Image")9 unmodified lines101112131415161728 unmodified lines464748495051525311 unmodified lines656667686970717273747576232 unmodified lines3093103113123133143153163173183199 unmodified linesimport randomimport gcimport copyimport osimport shutilfrom torchao.quantization import quantize_from torchao.quantization import Float8DynamicActivationFloat8WeightConfig28 unmodified linesMIN_DURATION = round(MIN_FRAMES_MODEL / FIXED_FPS, 1)MAX_DURATION = round(MAX_FRAMES_MODEL / FIXED_FPS, 1)CACHE_DIR = os.path.expanduser("~/.cache/huggingface/")SCHEDULER_MAP = {"FlowMatchEulerDiscrete": FlowMatchEulerDiscreteScheduler,"SASolver": SASolverScheduler,11 unmodified linesoriginal_scheduler = copy.deepcopy(pipe.scheduler)print(original_scheduler)if os.path.exists(CACHE_DIR):shutil.rmtree(CACHE_DIR)print("Deleted Hugging Face cache.")else:print("No hub cache found.")quantize_(pipe.text_encoder, Int8WeightOnlyConfig())quantize_(pipe.transformer, Float8DynamicActivationFloat8WeightConfig())quantize_(pipe.transformer_2, Float8DynamicActivationFloat8WeightConfig())232 unmodified linesreturn video_path, video_path, current_seedwith gr.Blocks(theme=gr.themes.Soft(), delete_cache=(3600, 10800)) as demo:gr.Markdown("# WAMU V2 - Wan 2.2 I2V (14B) 🐢")gr.Markdown("## ℹ️ **A Note on Performance:** This version prioritizes a straightforward setup over maximum speed, so performance may vary.")gr.Markdown('Try the previous version: [WAMU v1](https://huggingface.co/spaces/r3gm/wan2-2-fp8da-aoti-preview2)')gr.Markdown("Run Wan 2.2 in just 4-8 steps, fp8 quantization & AoT compilation - compatible with 🧨 diffusers and ZeroGPU")with gr.Row():with gr.Column():input_image_component = gr.Image(type="pil", label="Input Image")
app.py+12-2