Spaces:
Runtime error
Runtime error
Commit ·
c53fc43
1
Parent(s): b054e3b
renaming
Browse files105 unmodified lines1061071081091101091101111121131141141151161179 unmodified lines12712812913013013113213333 unmodified lines16716816917017017117217318 unmodified lines19219319419519519619719882 unmodified lines28128228328428428528628775 unmodified lines363364365366366367368368369370371105 unmodified linesdef make_sidebar(): with st.sidebar: input_image = st.file_uploader("", type=["png", "jpg"], key='input_image', on_change=on_upload) generation_mode = st.selectbox("Generation mode", ["Re-generate objects", "Segmentation conditioning", generation_mode = st.selectbox("Generation mode", ["Regenerate", "Segmentation", "Inpainting"], on_change=on_change_radio)
if generation_mode == "Segmentation conditioning": if generation_mode == "Segmentation": paint_mode = st.sidebar.selectbox("Painting mode", ("freedraw", "polygon")) if paint_mode == "freedraw": brush = st.slider("Stroke width", 5, 140, 100, key='slider_seg')9 unmodified lines "Choose a color", chosen_colors, index=0, format_func=map_colors, key='color_chooser' )
elif generation_mode == "Re-generate objects": elif generation_mode == "Regenerate": color_chooser = "rgba(0, 0, 0, 0.0)" paint_mode = 'freedraw' brush = 033 unmodified lines brush=brush, _reset_state=_reset_state ) if generation_mode == "Segmentation conditioning": if generation_mode == "Segmentation": canvas = st_canvas( **canvas_dict, )18 unmodified lines st.session_state['output_image'] = result_image
elif generation_mode == "Re-generate objects": elif generation_mode == "Regenerate": canvas = st_canvas( **canvas_dict, )82 unmodified lines st.write("Welcome to the interior design controlnet demo! " "You can start by uploading a picture of your room, after which you will see " "a good variety of options to edit your current room to generate the room of your dreams! " "You can choose between inpainting, segmentation conditioning and re-generating objects, which " "You can choose between inpainting, Segmentation and re-generating objects, which " "use our custom trained controlnet model." ) with st.expander("Useful information", expanded=True):75 unmodified lines
if generation_mode == "Inpainting": make_inpainting_explanation() elif generation_mode == "Segmentation conditioning": elif generation_mode == "Segmentation": make_segmentation_explanation() elif generation_mode == "Re-generate objects": elif generation_mode == "Regenerate": make_regeneration_explanation()
col1, col2 = st.columns(2)app.py+9-9