Spaces:
Build error
Build error
Update
Browse files42 unmodified lines43444546474849505152535455565758596061626364656665 unmodified lines13213313413513613713813914042 unmodified linesfrom app_seg import create_demo as create_demo_segfrom model import ModelDESCRIPTION = '''# ControlNetThis 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.'''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/>'''MAX_IMAGES = int(os.getenv('MAX_IMAGES', '3'))65 unmodified linesinteractive=ALLOW_CHANGING_BASE_MODEL)with gr.Column(scale=0.3):change_base_model_button = gr.Button('Change base model')check_base_model_button.click(fn=lambda: model.base_model_id,outputs=current_base_model)base_model_id.submit(fn=model.set_base_model,inputs=base_model_id,outputs=current_base_model)42 unmodified lines4344454647484950515253545565 unmodified lines12112212312412512612712812913013113213313413513613713842 unmodified linesfrom app_seg import create_demo as create_demo_segfrom model import ModelDESCRIPTION = '# [ControlNet](https://github.com/lllyasviel/ControlNet)'SPACE_ID = os.getenv('SPACE_ID')ALLOW_CHANGING_BASE_MODEL = SPACE_ID != 'hysts/ControlNet'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. <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 linesinteractive=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,queue=False)base_model_id.submit(fn=model.set_base_model,inputs=base_model_id,outputs=current_base_model)
app.py+12-14