Bobby commited on
Commit
651b4a6
·
1 Parent(s): 3a7a5a5

torch compile

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -86,6 +86,8 @@ if gr.NO_RELOAD:
86
 
87
  # experimental speedup?
88
  # pipe.compile()
 
 
89
 
90
  # torch.cuda.empty_cache()
91
  # gc.collect()
@@ -350,7 +352,6 @@ def process_image(
350
  ):
351
  print("processing image")
352
  start = time.time()
353
- torch.cuda.empty_cache()
354
  preprocessor.load("NormalBae")
355
  # preprocessor.load("Canny") #20 steps, 9 guidance, 512, 512
356
 
 
86
 
87
  # experimental speedup?
88
  # pipe.compile()
89
+ pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
90
+ print("Model Compiled!")
91
 
92
  # torch.cuda.empty_cache()
93
  # gc.collect()
 
352
  ):
353
  print("processing image")
354
  start = time.time()
 
355
  preprocessor.load("NormalBae")
356
  # preprocessor.load("Canny") #20 steps, 9 guidance, 512, 512
357