change 10 images to 4 images
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ pipe = pipe.to(device)
|
|
17 |
model, preprocess = clip.load("ViT-B/32", device=device)
|
18 |
|
19 |
def generate_image(text_prompt):
|
20 |
-
images = pipe(text_prompt, num_images_per_prompt=
|
21 |
return images
|
22 |
|
23 |
def build_generation_block(prompt):
|
@@ -34,7 +34,7 @@ def build_generation_block(prompt):
|
|
34 |
|
35 |
gallery = gr.Gallery(
|
36 |
label="Generated images", show_label=False, elem_id="gallery"
|
37 |
-
).style(columns=[
|
38 |
|
39 |
btn.click(generate_image, text, gallery)
|
40 |
|
|
|
17 |
model, preprocess = clip.load("ViT-B/32", device=device)
|
18 |
|
19 |
def generate_image(text_prompt):
|
20 |
+
images = pipe(text_prompt, num_images_per_prompt=4).images
|
21 |
return images
|
22 |
|
23 |
def build_generation_block(prompt):
|
|
|
34 |
|
35 |
gallery = gr.Gallery(
|
36 |
label="Generated images", show_label=False, elem_id="gallery"
|
37 |
+
).style(columns=[2], rows=[2], object_fit="contain", height="auto")
|
38 |
|
39 |
btn.click(generate_image, text, gallery)
|
40 |
|