hysts HF staff commited on
Commit
afddbfd
1 Parent(s): bbf85db
Files changed (2) hide show
  1. app.py +2 -5
  2. settings.py +1 -0
app.py CHANGED
@@ -21,13 +21,10 @@ from app_segmentation import create_demo as create_demo_segmentation
21
  from app_shuffle import create_demo as create_demo_shuffle
22
  from app_softedge import create_demo as create_demo_softedge
23
  from model import Model
24
- from settings import SHOW_DUPLICATE_BUTTON
25
 
26
  DESCRIPTION = '# ControlNet v1.1'
27
 
28
- SPACE_ID = os.getenv('SPACE_ID')
29
- ALLOW_CHANGING_BASE_MODEL = SPACE_ID != 'hysts/ControlNet-v1-1'
30
-
31
  if not torch.cuda.is_available():
32
  DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
33
 
@@ -88,7 +85,7 @@ with gr.Blocks(css='style.css') as demo:
88
  'Change base model', interactive=ALLOW_CHANGING_BASE_MODEL)
89
  if not ALLOW_CHANGING_BASE_MODEL:
90
  gr.Markdown(
91
- '''The base model is not allowed to be changed in this Space so as not to slow down the demo, but it can be changed if you duplicate the Space. <a href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="display: inline; margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space" /></a>'''
92
  )
93
 
94
  check_base_model_button.click(fn=lambda: model.base_model_id,
 
21
  from app_shuffle import create_demo as create_demo_shuffle
22
  from app_softedge import create_demo as create_demo_softedge
23
  from model import Model
24
+ from settings import ALLOW_CHANGING_BASE_MODEL, SHOW_DUPLICATE_BUTTON
25
 
26
  DESCRIPTION = '# ControlNet v1.1'
27
 
 
 
 
28
  if not torch.cuda.is_available():
29
  DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
30
 
 
85
  'Change base model', interactive=ALLOW_CHANGING_BASE_MODEL)
86
  if not ALLOW_CHANGING_BASE_MODEL:
87
  gr.Markdown(
88
+ '''The base model is not allowed to be changed in this Space so as not to slow down the demo, but it can be changed if you duplicate the Space.'''
89
  )
90
 
91
  check_base_model_button.click(fn=lambda: model.base_model_id,
settings.py CHANGED
@@ -1,5 +1,6 @@
1
  import os
2
 
 
3
  SHOW_DUPLICATE_BUTTON = os.getenv('SHOW_DUPLICATE_BUTTON') == '1'
4
 
5
  MAX_NUM_IMAGES = int(os.getenv('MAX_NUM_IMAGES', '3'))
 
1
  import os
2
 
3
+ ALLOW_CHANGING_BASE_MODEL = os.getenv('SPACE_ID') != 'hysts/ControlNet-v1-1'
4
  SHOW_DUPLICATE_BUTTON = os.getenv('SHOW_DUPLICATE_BUTTON') == '1'
5
 
6
  MAX_NUM_IMAGES = int(os.getenv('MAX_NUM_IMAGES', '3'))