fffiloni commited on
Commit
7a1fd8b
·
verified ·
1 Parent(s): 69458a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -78,7 +78,7 @@ def generate_image(prompt, model, num_iterations, learning_rate, progress=gr.Pro
78
  best_image, total_init_rewards, total_best_rewards = main(args, progress_callback)
79
 
80
  # Return the path to the generated image
81
- image_path = f"{save_dir}/best_image.png"
82
 
83
  if os.path.exists(image_path):
84
  iter_images = list_iter_images(save_dir)
@@ -132,7 +132,7 @@ with gr.Blocks() as demo:
132
  )
133
 
134
  with gr.Column():
135
- output_image = gr.Image(type="filepath", label="Generated Image")
136
  status = gr.Textbox(label="Status")
137
  iter_gallery = gr.Gallery(label="Iterations", columns=4)
138
 
 
78
  best_image, total_init_rewards, total_best_rewards = main(args, progress_callback)
79
 
80
  # Return the path to the generated image
81
+ image_path = best_image
82
 
83
  if os.path.exists(image_path):
84
  iter_images = list_iter_images(save_dir)
 
132
  )
133
 
134
  with gr.Column():
135
+ output_image = gr.Image(type="filepath", label="Best Generated Image")
136
  status = gr.Textbox(label="Status")
137
  iter_gallery = gr.Gallery(label="Iterations", columns=4)
138