JiayiGuo821 commited on
Commit
06a6c1e
·
1 Parent(s): 5d635a7
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -277,6 +277,7 @@ class wrapper(object):
277
  self.cache_inverse_folder = "temp/inverse"
278
  self.cache_inverse_maxn = 500
279
 
 
280
  def load_all(self, tag_diffuser, tag_lora, tag_scheduler):
281
  self.load_diffuser_lora(tag_diffuser, tag_lora)
282
  self.load_scheduler(tag_scheduler)
@@ -294,6 +295,7 @@ class wrapper(object):
294
  self.tag_lora = tag_lora
295
  return tag_diffuser, tag_lora
296
 
 
297
  def load_scheduler(self, tag_scheduler):
298
  self.net.scheduler = choices.scheduler[tag_scheduler].from_config(self.net.scheduler.config)
299
  self.tag_scheduler = tag_scheduler
@@ -311,7 +313,7 @@ class wrapper(object):
311
  ##########
312
  # helper #
313
  ##########
314
-
315
  def precheck_model(self, tag_diffuser, tag_lora, tag_scheduler):
316
  if (tag_diffuser != self.tag_diffuser) or (tag_lora != self.tag_lora):
317
  self.load_all(tag_diffuser, tag_lora, tag_scheduler)
 
277
  self.cache_inverse_folder = "temp/inverse"
278
  self.cache_inverse_maxn = 500
279
 
280
+ @spaces.GPU()
281
  def load_all(self, tag_diffuser, tag_lora, tag_scheduler):
282
  self.load_diffuser_lora(tag_diffuser, tag_lora)
283
  self.load_scheduler(tag_scheduler)
 
295
  self.tag_lora = tag_lora
296
  return tag_diffuser, tag_lora
297
 
298
+ @spaces.GPU()
299
  def load_scheduler(self, tag_scheduler):
300
  self.net.scheduler = choices.scheduler[tag_scheduler].from_config(self.net.scheduler.config)
301
  self.tag_scheduler = tag_scheduler
 
313
  ##########
314
  # helper #
315
  ##########
316
+ @spaces.GPU()
317
  def precheck_model(self, tag_diffuser, tag_lora, tag_scheduler):
318
  if (tag_diffuser != self.tag_diffuser) or (tag_lora != self.tag_lora):
319
  self.load_all(tag_diffuser, tag_lora, tag_scheduler)