yonishafir commited on
Commit
9f67309
·
verified ·
1 Parent(s): 964088f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
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
- return gr.Gallery.update(
296
- value=images,
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").style(grid=[2], height="auto") # Default to 2 columns
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,