File size: 716 Bytes
807d4f8
81e3fc5
75c35ad
81e3fc5
807d4f8
81e3fc5
7fab264
807d4f8
 
 
 
 
 
 
 
 
0b4487e
35e93a9
807d4f8
 
6d6821e
807d4f8
 
75c35ad
807d4f8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from diffusers import DiffusionPipeline
import gradio as gr
import sys 

generator = DiffusionPipeline.from_pretrained("kaveh/wsi_generator")

def generate(n_samples=1):
    images = []
    for i in range(n_samples):
        image = generator().images[0]
        images.append(image)
    return images
    
with gr.Blocks() as demo:
    with gr.Column(variant="panel"):
        with gr.Row(variant="compact"):
            n_s = gr.Slider(1, 4, label='Number of Samples', value=1, step=1.0, show_label=True)
            btn = gr.Button("Generate image")

        gallery = gr.Gallery(
            label="Generated images", show_label=False, elem_id="gallery")

    btn.click(generate, n_s, gallery)
    
demo.launch()