multimodalart HF Staff commited on
Commit
f8f1d1d
·
verified ·
1 Parent(s): ce21d07

Pre-Compiled AoTI (#21)

Browse files

- Pre-Compiled AoTI (f0dfdd22d5bce950dae8826ef43b375a7f700ba0)
- Update requirements.txt (f04829345d61a073405442ddc260c45b7482edf8)

Files changed (2) hide show
  1. app.py +5 -3
  2. requirements.txt +2 -1
app.py CHANGED
@@ -186,12 +186,14 @@ except Exception as e:
186
  print(f"Warning: Could not load Lightning LoRA weights: {e}")
187
  print("Continuing with base model...")
188
 
 
 
189
  # Apply the same optimizations from the first version
190
- pipe.transformer.__class__ = QwenImageTransformer2DModel
191
- pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
192
 
193
  # --- Ahead-of-time compilation ---
194
- optimize_pipeline_(pipe, image=Image.new("RGB", (1024, 1024)), prompt="prompt")
195
 
196
  # --- UI Constants and Helpers ---
197
  MAX_SEED = np.iinfo(np.int32).max
 
186
  print(f"Warning: Could not load Lightning LoRA weights: {e}")
187
  print("Continuing with base model...")
188
 
189
+ spaces.aoti_blocks_load(pipe.transformer, "zerogpu-aoti/Qwen-Image", variant="fa3")
190
+
191
  # Apply the same optimizations from the first version
192
+ # pipe.transformer.__class__ = QwenImageTransformer2DModel
193
+ # pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
194
 
195
  # --- Ahead-of-time compilation ---
196
+ # optimize_pipeline_(pipe, image=Image.new("RGB", (1024, 1024)), prompt="prompt")
197
 
198
  # --- UI Constants and Helpers ---
199
  MAX_SEED = np.iinfo(np.int32).max
requirements.txt CHANGED
@@ -7,4 +7,5 @@ safetensors
7
  sentencepiece
8
  dashscope
9
  torchvision
10
- peft
 
 
7
  sentencepiece
8
  dashscope
9
  torchvision
10
+ peft
11
+ torch==2.8