Spaces:
Runtime error
Runtime error
Commit ·
6a46ded
1
Parent(s): 9ff56a4
add ex
Browse files149 unmodified lines150151152153154155156157112 unmodified lines27027127227327427527628 unmodified lines305306307308309310311312313314315316149 unmodified linesst.write("#### Output image")st.image(output_image, width=512)if st.button("Move to input image"):move_image('output_image', 'initial_image', remove_state=False, rerun=False)move_image('output_image', 'input_image', remove_state=True, rerun=True)def make_editing_canvas(canvas_color, brush, _reset_state, generation_mode, paint_mode):st.write("#### Input image")112 unmodified linesinput_image, generation_mode, brush, color_chooser, paint_mode = make_sidebar()# check if there is an input_imageif not ('input_image' in st.session_state and st.session_state['input_image'] is not None):st.success("Upload an image to start")st.write("Welcome to the interior design controlnet demo! ""You can start by uploading a picture of your room, after which you will see "28 unmodified lineswith col_im_0:st.image(st.session_state['example_image_0'], caption="Example image 1", use_column_width=True)if st.button("Use example 1"):move_image('example_image_0', 'input_image', remove_state=True, rerun=False)move_image('example_image_0', 'initial_image', remove_state=True, rerun=True)with col_im_1:st.image(st.session_state['example_image_1'], caption="Example image 2", use_column_width=True)if st.button("Use example 2"):move_image('example_image_1', 'input_image', remove_state=True, rerun=False)move_image('example_image_1', 'initial_image', remove_state=True, rerun=True)st.write("## Generated examples")149 unmodified lines150151152153154155156112 unmodified lines26927027127227327427528 unmodified lines304305306307308309310311312313149 unmodified linesst.write("#### Output image")st.image(output_image, width=512)if st.button("Move to input image"):move_image('output_image', 'initial_image', remove_state=True, rerun=True)def make_editing_canvas(canvas_color, brush, _reset_state, generation_mode, paint_mode):st.write("#### Input image")112 unmodified linesinput_image, generation_mode, brush, color_chooser, paint_mode = make_sidebar()# check if there is an input_imageif not ('initial_image' in st.session_state and st.session_state['initial_image'] is not None):st.success("Upload an image to start")st.write("Welcome to the interior design controlnet demo! ""You can start by uploading a picture of your room, after which you will see "28 unmodified lineswith col_im_0:st.image(st.session_state['example_image_0'], caption="Example image 1", use_column_width=True)if st.button("Use example 1"):move_image('example_image_0', 'initial_image', remove_state=True, rerun=True)with col_im_1:st.image(st.session_state['example_image_1'], caption="Example image 2", use_column_width=True)if st.button("Use example 2"):move_image('example_image_1', 'initial_image', remove_state=True, rerun=True)st.write("## Generated examples")
app.py+2-5