Spaces:
Running
on
Zero
Running
on
Zero
Update optimization.py
Browse files- optimization.py +7 -0
optimization.py
CHANGED
|
@@ -49,6 +49,13 @@ def optimize_pipeline_(pipeline: Callable[P, Any], *args: P.args, **kwargs: P.kw
|
|
| 49 |
|
| 50 |
@spaces.GPU(duration=1500)
|
| 51 |
def compile_transformer():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
with spaces.aoti_capture(pipeline.transformer) as call:
|
| 54 |
pipeline(*args, **kwargs)
|
|
|
|
| 49 |
|
| 50 |
@spaces.GPU(duration=1500)
|
| 51 |
def compile_transformer():
|
| 52 |
+
|
| 53 |
+
pipeline.load_lora_weights(
|
| 54 |
+
"lightx2v/Qwen-Image-Lightning",
|
| 55 |
+
weight_name="Qwen-Image-Lightning-8steps-V1.1.safetensors"
|
| 56 |
+
)
|
| 57 |
+
pipeline.fuse_lora()
|
| 58 |
+
pipeline.unload_lora_weights()
|
| 59 |
|
| 60 |
with spaces.aoti_capture(pipeline.transformer) as call:
|
| 61 |
pipeline(*args, **kwargs)
|