vumichien commited on
Commit
0aa9213
1 Parent(s): e406bc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -31,7 +31,7 @@ st.set_page_config(
31
 
32
  save_memory = False
33
 
34
- @st.cache_resource
35
  def load_model():
36
  model_path = hf_hub_download('lllyasviel/ControlNet', 'models/control_sd15_scribble.pth')
37
  model = create_model('./models/cldm_v15.yaml').cpu()
@@ -39,7 +39,7 @@ def load_model():
39
  model = model.cuda()
40
  return model
41
 
42
-
43
  def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, detect_resolution, ddim_steps, guess_mode, strength, scale, seed, eta):
44
  with torch.no_grad():
45
 
@@ -89,7 +89,7 @@ def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resoluti
89
  # return [255 - detected_map] + results
90
  return results
91
 
92
- @st.cache_data
93
  def load_lottieurl(url: str):
94
  r = requests.get(url)
95
  if r.status_code != 200:
 
31
 
32
  save_memory = False
33
 
34
+ @st.experimental_singleton
35
  def load_model():
36
  model_path = hf_hub_download('lllyasviel/ControlNet', 'models/control_sd15_scribble.pth')
37
  model = create_model('./models/cldm_v15.yaml').cpu()
 
39
  model = model.cuda()
40
  return model
41
 
42
+ @st.experimental_singleton
43
  def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, detect_resolution, ddim_steps, guess_mode, strength, scale, seed, eta):
44
  with torch.no_grad():
45
 
 
89
  # return [255 - detected_map] + results
90
  return results
91
 
92
+ @st.experimental_memo
93
  def load_lottieurl(url: str):
94
  r = requests.get(url)
95
  if r.status_code != 200: