Spaces:
Build error
Build error
Update
Browse files42 unmodified lines434445464748495051464748495056575851606162635253545565 unmodified lines12112212312412512612712812913013113213313713413513613713842 unmodified linesfrom app_seg import create_demo as create_demo_segfrom model import Model
DESCRIPTION = '''# ControlNet
This is an unofficial demo for [https://github.com/lllyasviel/ControlNet](https://github.com/lllyasviel/ControlNet).
If you are interested in trying out other base models, check out [this Space](https://huggingface.co/spaces/hysts/ControlNet-with-other-models) as well.'''DESCRIPTION = '# [ControlNet](https://github.com/lllyasviel/ControlNet)'
SPACE_ID = os.getenv('SPACE_ID')ALLOW_CHANGING_BASE_MODEL = SPACE_ID != 'hysts/ControlNet'
if not ALLOW_CHANGING_BASE_MODEL: DESCRIPTION += 'In this Space, the base model is not allowed to be changed so as not to slow down the demo, but it can be changed if you duplicate the Space.'
if SPACE_ID is not None: DESCRIPTION += f'''<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings.<br/><a href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a><p/> 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>'''
MAX_IMAGES = int(os.getenv('MAX_IMAGES', '3'))65 unmodified lines interactive=ALLOW_CHANGING_BASE_MODEL) with gr.Column(scale=0.3): change_base_model_button = gr.Button('Change base model') if not ALLOW_CHANGING_BASE_MODEL: gr.Markdown( '''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>''' )
gr.Markdown( '[Space using Anything-v4.0 as base model](https://huggingface.co/spaces/hysts/ControlNet-with-other-models)' )
check_base_model_button.click(fn=lambda: model.base_model_id, outputs=current_base_model) outputs=current_base_model, queue=False) base_model_id.submit(fn=model.set_base_model, inputs=base_model_id, outputs=current_base_model)app.py+12-14