import gradio as gr import numpy as np def initiate(images_num): zeros = np.zeros([256,256,3], dtype=np.uint8) zeros.fill(255) img_array = [] for i in range(images_num): img_array.append(zeros) demo = gr.Blocks() with demo: images_num = gr.inputs.Slider(default=1, label="Num Images", minimum=1, maximum=16, step=1) #interpolate = gr.inputs.Checkbox(default=False, label="Interpolate") submit = gr.Button("Generate") out = gr.Gallery() submit.click(fn=initiate, #inputs=[images_num, interpolate], inputs=images_num, outputs=out) demo.launch(enable_queue =True)