import gradio as gr from sam2edit import create_demo as create_demo_edit_anything # from sam2image import create_demo as create_demo_generate_anything DESCRIPTION = f'''# [Edit Anything](https://github.com/sail-sg/EditAnything) **Edit anything and keep the layout by segmenting anything in the image.** ''' SHARED_UI_WARNING = f'''### [NOTE] Inference may be slow in this shared UI. You can duplicate and use it with a paid private GPU. Duplicate Space ''' with gr.Blocks() as demo: gr.Markdown(DESCRIPTION) with gr.Tabs(): with gr.TabItem('Edit Anything'): create_demo_edit_anything() # with gr.TabItem('Generate Anything'): # create_demo_generate_anything() with gr.Box(): gr.Markdown(SHARED_UI_WARNING) demo.queue(api_open=False).launch()