Spaces:
Build error
Build error
limit max number of images (#2)
Browse files- limit max number of images (e3991bb3aa63c7ab6ada87407864ca7dd31d68bd)
Co-authored-by: Radamés Ajna <radames@users.noreply.huggingface.co>
Files changed (11)
35 unmodified lines3637383940414211 unmodified lines545556565758585960606162626364656566676768696970717172737374757576777835 unmodified linesfrom gradio_seg2image import create_demo as create_demo_segfrom model import Model
MAX_IMAGES = 1DESCRIPTION = '''# ControlNet
This is an unofficial demo for [https://github.com/lllyasviel/ControlNet](https://github.com/lllyasviel/ControlNet).11 unmodified lines gr.Markdown(DESCRIPTION) with gr.Tabs(): with gr.TabItem('Canny'): create_demo_canny(model.process_canny) create_demo_canny(model.process_canny, max_images=MAX_IMAGES) with gr.TabItem('Hough'): create_demo_hough(model.process_hough) create_demo_hough(model.process_hough, max_images=MAX_IMAGES) with gr.TabItem('HED'): create_demo_hed(model.process_hed) create_demo_hed(model.process_hed, max_images=MAX_IMAGES) with gr.TabItem('Scribble'): create_demo_scribble(model.process_scribble) create_demo_scribble(model.process_scribble, max_images=MAX_IMAGES) with gr.TabItem('Scribble Interactive'): create_demo_scribble_interactive( model.process_scribble_interactive) model.process_scribble_interactive, max_images=MAX_IMAGES) with gr.TabItem('Fake Scribble'): create_demo_fake_scribble(model.process_fake_scribble) create_demo_fake_scribble(model.process_fake_scribble, max_images=MAX_IMAGES) with gr.TabItem('Pose'): create_demo_pose(model.process_pose) create_demo_pose(model.process_pose, max_images=MAX_IMAGES) with gr.TabItem('Segmentation'): create_demo_seg(model.process_seg) create_demo_seg(model.process_seg, max_images=MAX_IMAGES) with gr.TabItem('Depth'): create_demo_depth(model.process_depth) create_demo_depth(model.process_depth, max_images=MAX_IMAGES) with gr.TabItem('Normal map'): create_demo_normal(model.process_normal) create_demo_normal(model.process_normal, max_images=MAX_IMAGES)
demo.queue(api_open=False).launch()2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with Canny Edge Maps')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with Depth Maps')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with Fake Scribble Maps')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with HED Maps')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with Hough Line Maps')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with Normal Maps')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with Human Pose')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with Scribble Maps')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',7 unmodified lines8910111112131428 unmodified lines43444546464748497 unmodified lines return np.zeros(shape=(h, w, 3), dtype=np.uint8) + 255
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown(28 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',2 unmodified lines345667895 unmodified lines15161718181920212 unmodified linesimport gradio as gr
def create_demo(process):def create_demo(process, max_images=12): with gr.Blocks() as demo: with gr.Row(): gr.Markdown('## Control Stable Diffusion with Segmentation Maps')5 unmodified lines with gr.Accordion('Advanced options', open=False): num_samples = gr.Slider(label='Images', minimum=1, maximum=12, maximum=max_images, value=1, step=1) image_resolution = gr.Slider(label='Image Resolution',app.py+11-10
gradio_canny2image.py+2-2
gradio_depth2image.py+2-2
gradio_fake_scribble2image.py+2-2
gradio_hed2image.py+2-2
gradio_hough2image.py+2-2
gradio_normal2image.py+2-2
gradio_pose2image.py+2-2
gradio_scribble2image.py+2-2
gradio_scribble2image_interactive.py+2-2
gradio_seg2image.py+2-2