ovi054 commited on
Commit
8cdb8cb
·
verified ·
1 Parent(s): 8e5bc9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -5,6 +5,8 @@ import spaces
5
  import torch
6
  from diffusers import QwenImagePipeline
7
 
 
 
8
  dtype = torch.bfloat16
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
 
@@ -30,6 +32,10 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
30
  if lora_id and lora_id.strip() != "":
31
  pipe.unload_lora_weights()
32
  pipe.load_lora_weights(lora_id.strip())
 
 
 
 
33
 
34
  try:
35
  image = pipe(
 
5
  import torch
6
  from diffusers import QwenImagePipeline
7
 
8
+ from para_attn.first_block_cache.diffusers_adapters import apply_cache_on_pipe
9
+
10
  dtype = torch.bfloat16
11
  device = "cuda" if torch.cuda.is_available() else "cpu"
12
 
 
32
  if lora_id and lora_id.strip() != "":
33
  pipe.unload_lora_weights()
34
  pipe.load_lora_weights(lora_id.strip())
35
+
36
+ apply_cache_on_pipe(
37
+ pipe,
38
+ )
39
 
40
  try:
41
  image = pipe(