BertChristiaens commited on
Commit
6a46ded
1 Parent(s): 9ff56a4
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -150,8 +150,7 @@ def make_output_image():
150
  st.write("#### Output image")
151
  st.image(output_image, width=512)
152
  if st.button("Move to input image"):
153
- move_image('output_image', 'initial_image', remove_state=False, rerun=False)
154
- move_image('output_image', 'input_image', remove_state=True, rerun=True)
155
 
156
  def make_editing_canvas(canvas_color, brush, _reset_state, generation_mode, paint_mode):
157
  st.write("#### Input image")
@@ -270,7 +269,7 @@ def main():
270
  input_image, generation_mode, brush, color_chooser, paint_mode = make_sidebar()
271
 
272
  # check if there is an input_image
273
- if not ('input_image' in st.session_state and st.session_state['input_image'] is not None):
274
  st.success("Upload an image to start")
275
  st.write("Welcome to the interior design controlnet demo! "
276
  "You can start by uploading a picture of your room, after which you will see "
@@ -305,12 +304,10 @@ def main():
305
  with col_im_0:
306
  st.image(st.session_state['example_image_0'], caption="Example image 1", use_column_width=True)
307
  if st.button("Use example 1"):
308
- move_image('example_image_0', 'input_image', remove_state=True, rerun=False)
309
  move_image('example_image_0', 'initial_image', remove_state=True, rerun=True)
310
  with col_im_1:
311
  st.image(st.session_state['example_image_1'], caption="Example image 2", use_column_width=True)
312
  if st.button("Use example 2"):
313
- move_image('example_image_1', 'input_image', remove_state=True, rerun=False)
314
  move_image('example_image_1', 'initial_image', remove_state=True, rerun=True)
315
 
316
  st.write("## Generated examples")
 
150
  st.write("#### Output image")
151
  st.image(output_image, width=512)
152
  if st.button("Move to input image"):
153
+ move_image('output_image', 'initial_image', remove_state=True, rerun=True)
 
154
 
155
  def make_editing_canvas(canvas_color, brush, _reset_state, generation_mode, paint_mode):
156
  st.write("#### Input image")
 
269
  input_image, generation_mode, brush, color_chooser, paint_mode = make_sidebar()
270
 
271
  # check if there is an input_image
272
+ if not ('initial_image' in st.session_state and st.session_state['initial_image'] is not None):
273
  st.success("Upload an image to start")
274
  st.write("Welcome to the interior design controlnet demo! "
275
  "You can start by uploading a picture of your room, after which you will see "
 
304
  with col_im_0:
305
  st.image(st.session_state['example_image_0'], caption="Example image 1", use_column_width=True)
306
  if st.button("Use example 1"):
 
307
  move_image('example_image_0', 'initial_image', remove_state=True, rerun=True)
308
  with col_im_1:
309
  st.image(st.session_state['example_image_1'], caption="Example image 2", use_column_width=True)
310
  if st.button("Use example 2"):
 
311
  move_image('example_image_1', 'initial_image', remove_state=True, rerun=True)
312
 
313
  st.write("## Generated examples")