Spaces:
Runtime error
Runtime error
Update optimization.py
Browse files- optimization.py +7 -0
optimization.py
CHANGED
@@ -50,6 +50,13 @@ def optimize_pipeline_(pipeline: Callable[P, Any], *args: P.args, **kwargs: P.kw
|
|
50 |
@spaces.GPU(duration=1500)
|
51 |
def compile_transformer():
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
with spaces.aoti_capture(pipeline.transformer) as call:
|
54 |
pipeline(*args, **kwargs)
|
55 |
|
|
|
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)
|
62 |
|