Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,11 @@ import torch
|
|
| 5 |
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
|
| 13 |
|
| 14 |
from huggingface_hub import InferenceClient
|
| 15 |
import math
|
|
@@ -243,12 +243,12 @@ pipe.load_lora_weights(
|
|
| 243 |
)
|
| 244 |
pipe.fuse_lora()
|
| 245 |
|
| 246 |
-
# Apply the same optimizations from the first version
|
| 247 |
-
pipe.transformer.__class__ = QwenImageTransformer2DModel
|
| 248 |
-
pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
|
| 249 |
|
| 250 |
-
# --- Ahead-of-time compilation ---
|
| 251 |
-
optimize_pipeline_(pipe, image=[Image.new("RGB", (1024, 1024)), Image.new("RGB", (1024, 1024))], prompt="prompt")
|
| 252 |
|
| 253 |
# --- UI Constants and Helpers ---
|
| 254 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
| 5 |
import spaces
|
| 6 |
|
| 7 |
from PIL import Image
|
| 8 |
+
from diffusers import FlowMatchEulerDiscreteScheduler, QwenImageEditPlusPipeline
|
| 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
|
| 13 |
|
| 14 |
from huggingface_hub import InferenceClient
|
| 15 |
import math
|
|
|
|
| 243 |
)
|
| 244 |
pipe.fuse_lora()
|
| 245 |
|
| 246 |
+
# # Apply the same optimizations from the first version
|
| 247 |
+
# pipe.transformer.__class__ = QwenImageTransformer2DModel
|
| 248 |
+
# pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
|
| 249 |
|
| 250 |
+
# # --- Ahead-of-time compilation ---
|
| 251 |
+
# optimize_pipeline_(pipe, image=[Image.new("RGB", (1024, 1024)), Image.new("RGB", (1024, 1024))], prompt="prompt")
|
| 252 |
|
| 253 |
# --- UI Constants and Helpers ---
|
| 254 |
MAX_SEED = np.iinfo(np.int32).max
|