Spaces:
Runtime error
Runtime error
Change default values
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ from model import Model, download_all_controlnet_weights
|
|
46 |
DESCRIPTION = '# [ControlNet](https://github.com/lllyasviel/ControlNet)'
|
47 |
|
48 |
SPACE_ID = os.getenv('SPACE_ID')
|
49 |
-
ALLOW_CHANGING_BASE_MODEL = SPACE_ID != 'hysts/ControlNet'
|
50 |
|
51 |
if SPACE_ID is not None:
|
52 |
DESCRIPTION += f'''<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings. <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></p>
|
@@ -58,8 +58,7 @@ DEFAULT_NUM_IMAGES = min(MAX_IMAGES, int(os.getenv('DEFAULT_NUM_IMAGES', '1')))
|
|
58 |
if os.getenv('SYSTEM') == 'spaces':
|
59 |
download_all_controlnet_weights()
|
60 |
|
61 |
-
DEFAULT_MODEL_ID = os.getenv('DEFAULT_MODEL_ID',
|
62 |
-
'runwayml/stable-diffusion-v1-5')
|
63 |
model = Model(base_model_id=DEFAULT_MODEL_ID, task_name='canny')
|
64 |
|
65 |
with gr.Blocks(css='style.css') as demo:
|
@@ -129,10 +128,6 @@ with gr.Blocks(css='style.css') as demo:
|
|
129 |
'''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>'''
|
130 |
)
|
131 |
|
132 |
-
gr.Markdown(
|
133 |
-
'[Space using Anything-v4.0 as base model](https://huggingface.co/spaces/hysts/ControlNet-with-other-models)'
|
134 |
-
)
|
135 |
-
|
136 |
check_base_model_button.click(fn=lambda: model.base_model_id,
|
137 |
outputs=current_base_model,
|
138 |
queue=False)
|
|
|
46 |
DESCRIPTION = '# [ControlNet](https://github.com/lllyasviel/ControlNet)'
|
47 |
|
48 |
SPACE_ID = os.getenv('SPACE_ID')
|
49 |
+
ALLOW_CHANGING_BASE_MODEL = SPACE_ID != 'hysts/ControlNet-with-other-models'
|
50 |
|
51 |
if SPACE_ID is not None:
|
52 |
DESCRIPTION += f'''<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings. <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></p>
|
|
|
58 |
if os.getenv('SYSTEM') == 'spaces':
|
59 |
download_all_controlnet_weights()
|
60 |
|
61 |
+
DEFAULT_MODEL_ID = os.getenv('DEFAULT_MODEL_ID', 'andite/anything-v4.0')
|
|
|
62 |
model = Model(base_model_id=DEFAULT_MODEL_ID, task_name='canny')
|
63 |
|
64 |
with gr.Blocks(css='style.css') as demo:
|
|
|
128 |
'''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>'''
|
129 |
)
|
130 |
|
|
|
|
|
|
|
|
|
131 |
check_base_model_button.click(fn=lambda: model.base_model_id,
|
132 |
outputs=current_base_model,
|
133 |
queue=False)
|