Spaces:
Running
on
Zero
Running
on
Zero
Remove JIT compilation (#8)
Browse files- Remove JIT compilation (68eb1d688fa8c11bcfc58ed091d024b0a02240bf)
- Update requirements.txt (4056d01ec298c8ad47c39f5700d9388f8974d87f)
- app.py +5 -4
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import spaces
|
|
| 6 |
|
| 7 |
from PIL import Image
|
| 8 |
from diffusers import FlowMatchEulerDiscreteScheduler
|
| 9 |
-
from optimization import optimize_pipeline_
|
| 10 |
from qwenimage.pipeline_qwenimage_edit_plus import QwenImageEditPlusPipeline
|
| 11 |
from qwenimage.transformer_qwenimage import QwenImageTransformer2DModel
|
| 12 |
from qwenimage.qwen_fa3_processor import QwenDoubleStreamAttnProcessorFA3
|
|
@@ -395,13 +395,14 @@ pipe.set_adapters(["next-scene"], adapter_weights=[1.])
|
|
| 395 |
pipe.fuse_lora(adapter_names=["next-scene"], lora_scale=1.)
|
| 396 |
pipe.unload_lora_weights()
|
| 397 |
|
|
|
|
| 398 |
|
| 399 |
# Apply the same optimizations from the first version
|
| 400 |
-
pipe.transformer.__class__ = QwenImageTransformer2DModel
|
| 401 |
-
pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
|
| 402 |
|
| 403 |
# --- Ahead-of-time compilation ---
|
| 404 |
-
optimize_pipeline_(pipe, image=[Image.new("RGB", (1024, 1024)), Image.new("RGB", (1024, 1024))], prompt="prompt")
|
| 405 |
|
| 406 |
# --- UI Constants and Helpers ---
|
| 407 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
| 6 |
|
| 7 |
from PIL import Image
|
| 8 |
from diffusers import FlowMatchEulerDiscreteScheduler
|
| 9 |
+
# from optimization import optimize_pipeline_
|
| 10 |
from qwenimage.pipeline_qwenimage_edit_plus import QwenImageEditPlusPipeline
|
| 11 |
from qwenimage.transformer_qwenimage import QwenImageTransformer2DModel
|
| 12 |
from qwenimage.qwen_fa3_processor import QwenDoubleStreamAttnProcessorFA3
|
|
|
|
| 395 |
pipe.fuse_lora(adapter_names=["next-scene"], lora_scale=1.)
|
| 396 |
pipe.unload_lora_weights()
|
| 397 |
|
| 398 |
+
spaces.aoti_blocks_load(pipe.transformer, "zerogpu-aoti/Qwen-Image", variant="fa3")
|
| 399 |
|
| 400 |
# Apply the same optimizations from the first version
|
| 401 |
+
# pipe.transformer.__class__ = QwenImageTransformer2DModel
|
| 402 |
+
# pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
|
| 403 |
|
| 404 |
# --- Ahead-of-time compilation ---
|
| 405 |
+
# optimize_pipeline_(pipe, image=[Image.new("RGB", (1024, 1024)), Image.new("RGB", (1024, 1024))], prompt="prompt")
|
| 406 |
|
| 407 |
# --- UI Constants and Helpers ---
|
| 408 |
MAX_SEED = np.iinfo(np.int32).max
|
requirements.txt
CHANGED
|
@@ -8,4 +8,5 @@ dashscope
|
|
| 8 |
kernels
|
| 9 |
torchvision
|
| 10 |
peft
|
| 11 |
-
torchao==0.11.0
|
|
|
|
|
|
| 8 |
kernels
|
| 9 |
torchvision
|
| 10 |
peft
|
| 11 |
+
torchao==0.11.0
|
| 12 |
+
torch==2.8
|