gokaygokay commited on
Commit
eeb4af6
1 Parent(s): 853dea9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -5,6 +5,7 @@ import random
5
  from huggingface_hub import snapshot_download
6
  from diffusers import StableDiffusionXLPipeline, AutoencoderKL
7
  from diffusers import EulerAncestralDiscreteScheduler, DPMSolverMultistepScheduler, DPMSolverSDEScheduler
 
8
  import gradio as gr
9
  from PIL import Image
10
  from transformers import AutoProcessor, AutoModelForCausalLM, pipeline
@@ -27,6 +28,8 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
27
  )
28
  pipe = pipe.to("cuda")
29
 
 
 
30
  # Define samplers
31
  samplers = {
32
  "Euler a": EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config),
 
5
  from huggingface_hub import snapshot_download
6
  from diffusers import StableDiffusionXLPipeline, AutoencoderKL
7
  from diffusers import EulerAncestralDiscreteScheduler, DPMSolverMultistepScheduler, DPMSolverSDEScheduler
8
+ from diffusers.models.attention_processor import AttnProcessor2_0
9
  import gradio as gr
10
  from PIL import Image
11
  from transformers import AutoProcessor, AutoModelForCausalLM, pipeline
 
28
  )
29
  pipe = pipe.to("cuda")
30
 
31
+ pipe.unet.set_attn_processor(AttnProcessor2_0())
32
+
33
  # Define samplers
34
  samplers = {
35
  "Euler a": EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config),