Spaces:
Running
on
Zero
Running
on
Zero
yonishafir
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -292,10 +292,8 @@ def generate_image(image_path, prompt, num_steps, guidance_scale, seed, num_imag
|
|
292 |
gc.collect()
|
293 |
torch.cuda.empty_cache()
|
294 |
|
295 |
-
|
296 |
-
|
297 |
-
columns=1 if num_images == 1 else 2, # Show one column if one image, otherwise two
|
298 |
-
)
|
299 |
# return images
|
300 |
|
301 |
### Description
|
@@ -401,7 +399,7 @@ with gr.Blocks(css=css) as demo:
|
|
401 |
|
402 |
with gr.Column():
|
403 |
# gallery = gr.Gallery(label="Generated Images")
|
404 |
-
gallery = gr.Gallery(label="Generated Images"
|
405 |
|
406 |
submit.click(
|
407 |
fn=randomize_seed_fn,
|
|
|
292 |
gc.collect()
|
293 |
torch.cuda.empty_cache()
|
294 |
|
295 |
+
columns = 1 if num_images == 1 else 2
|
296 |
+
return gr.update(value=images, columns=columns)
|
|
|
|
|
297 |
# return images
|
298 |
|
299 |
### Description
|
|
|
399 |
|
400 |
with gr.Column():
|
401 |
# gallery = gr.Gallery(label="Generated Images")
|
402 |
+
gallery = gr.Gallery(label="Generated Images", columns=2) # Default to 2 columns
|
403 |
|
404 |
submit.click(
|
405 |
fn=randomize_seed_fn,
|