Spaces:
Running
on
Zero
Running
on
Zero
Elea Zhong
commited on
Commit
·
db0f5c9
1
Parent(s):
f7e5a2f
update app
Browse files
app.py
CHANGED
|
@@ -72,22 +72,26 @@ pipe.set_adapters(["fast_5k"], adapter_weights=[1.0])
|
|
| 72 |
pipe.fuse_lora(adapter_names=["fast_5k"], lora_scale=1.0)
|
| 73 |
pipe.unload_lora_weights()
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
pipe
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
"
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
MAX_SEED = np.iinfo(np.int32).max
|
| 93 |
|
|
|
|
| 72 |
pipe.fuse_lora(adapter_names=["fast_5k"], lora_scale=1.0)
|
| 73 |
pipe.unload_lora_weights()
|
| 74 |
|
| 75 |
+
@spaces.GPU(duration=1500)
|
| 76 |
+
def optim_pipe():
|
| 77 |
+
print(f"func cuda: {torch.cuda.is_available()=}")
|
| 78 |
+
|
| 79 |
+
pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
|
| 80 |
+
pipe.transformer.fuse_qkv_projections()
|
| 81 |
+
pipe.transformer.check_fused_qkv()
|
| 82 |
+
|
| 83 |
+
optimize_pipeline_(
|
| 84 |
+
pipe,
|
| 85 |
+
cache_compiled=True,
|
| 86 |
+
quantize=True,
|
| 87 |
+
suffix="_fp8darow_nolast_fa3_fast5k",
|
| 88 |
+
quantize_config=conf_fp8darow_nolast(),
|
| 89 |
+
pipe_kwargs={
|
| 90 |
+
"image": [Image.new("RGB", (1024, 1024))],
|
| 91 |
+
"prompt":"prompt",
|
| 92 |
+
"num_inference_steps":2,
|
| 93 |
+
}
|
| 94 |
+
)
|
| 95 |
|
| 96 |
MAX_SEED = np.iinfo(np.int32).max
|
| 97 |
|