import gradio as gr image_urls = [ "images/g1.png", "images/g2.png", "images/g3.png", ] def img_show(): # Create the list of images using the predefined list, indexed by i images = [ (image_urls[i], f"label {i}") for i in range(len(image_urls)) # Iterate through the fixed list ] return images with gr.Blocks() as demo: gr.Markdown(""" # Awesome result from multi concept DoRAs """) gallery = gr.Gallery( label="Generated images", show_label=False, elem_id="gallery" , columns=[3], rows=[1], object_fit="contain", height="auto") btn = gr.Button("Generate results", scale=0) btn.click(img_show, None, gallery) if __name__ == "__main__": demo.launch()