Menyu commited on
Commit
af7db3c
·
verified ·
1 Parent(s): 5a326e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,8 +10,6 @@ if not torch.cuda.is_available():
10
 
11
  MAX_SEED = np.iinfo(np.int32).max
12
  MAX_IMAGE_SIZE = 4096
13
- USE_TORCH_COMPILE = "1"
14
- ENABLE_CPU_OFFLOAD = "1"
15
 
16
  if torch.cuda.is_available():
17
  pipe = AutoPipelineForText2Image.from_pretrained(
@@ -21,6 +19,8 @@ if torch.cuda.is_available():
21
  add_watermarker=False
22
  )
23
  pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
 
 
24
  pipe.to("cuda")
25
 
26
  def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
 
10
 
11
  MAX_SEED = np.iinfo(np.int32).max
12
  MAX_IMAGE_SIZE = 4096
 
 
13
 
14
  if torch.cuda.is_available():
15
  pipe = AutoPipelineForText2Image.from_pretrained(
 
19
  add_watermarker=False
20
  )
21
  pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
22
+ pipe.unet = torch.compile(pipe.unet, mode="max-autotune", fullgraph=True)
23
+ pipe.vae.decode = torch.compile(pipe.vae.decode, mode="max-autotune", fullgraph=True)
24
  pipe.to("cuda")
25
 
26
  def randomize_seed_fn(seed: int, randomize_seed: bool) -> int: