mfidabel commited on
Commit
3804b82
1 Parent(s): 169ec0c

Changed Gallery Output

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -53,9 +53,11 @@ def infer(prompts, negative_prompts, image, num_inference_steps, seed, num_sampl
53
  jit=True,
54
  ).images
55
 
56
- print(output[0].shape)
 
 
57
 
58
- final_image = [np.array(x[0]*255, dtype=np.uint8) for x in output]
59
 
60
  del output
61
 
@@ -72,7 +74,7 @@ with gr.Blocks(css="h1 { text-align: center }") as demo:
72
  cond_img = gr.Image(label="Input")\
73
  .style(height=400)
74
  output = gr.Gallery(label="Generated images")\
75
- .style(height=400, rows=[2], columns=[2])
76
 
77
  # Submit & Clear
78
  with gr.Row():
 
53
  jit=True,
54
  ).images
55
 
56
+ output = output.reshape((num_samples,) + output.shape[-3:])
57
+
58
+ print(output.shape)
59
 
60
+ final_image = [np.array(x*255, dtype=np.uint8) for x in output]
61
 
62
  del output
63
 
 
74
  cond_img = gr.Image(label="Input")\
75
  .style(height=400)
76
  output = gr.Gallery(label="Generated images")\
77
+ .style(height="auto", rows=[2], columns=[1, 2])
78
 
79
  # Submit & Clear
80
  with gr.Row():