ovi054 commited on
Commit
bc8cbc8
·
verified ·
1 Parent(s): 4697f7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -4,6 +4,7 @@ import random
4
  import spaces
5
  import torch
6
  from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler, AutoencoderTiny, AutoencoderKL
 
7
  from transformers import CLIPTextModel, CLIPTokenizer,T5EncoderModel, T5TokenizerFast
8
  from live_preview_helpers import calculate_shift, retrieve_timesteps, flux_pipe_call_that_returns_an_iterable_of_images
9
 
@@ -47,6 +48,11 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
47
  joint_attention_kwargs = {"scale": lora_scale}
48
  else:
49
  joint_attention_kwargs = None
 
 
 
 
 
50
 
51
  try:
52
  # Call the custom pipeline function with the correct keyword argument
 
4
  import spaces
5
  import torch
6
  from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler, AutoencoderTiny, AutoencoderKL
7
+ from para_attn.first_block_cache.diffusers_adapters import apply_cache_on_pipe
8
  from transformers import CLIPTextModel, CLIPTokenizer,T5EncoderModel, T5TokenizerFast
9
  from live_preview_helpers import calculate_shift, retrieve_timesteps, flux_pipe_call_that_returns_an_iterable_of_images
10
 
 
48
  joint_attention_kwargs = {"scale": lora_scale}
49
  else:
50
  joint_attention_kwargs = None
51
+
52
+ apply_cache_on_pipe(
53
+ pipe,
54
+ # residual_diff_threshold=0.2,
55
+ )
56
 
57
  try:
58
  # Call the custom pipeline function with the correct keyword argument