ovshake commited on
Commit
da6de3d
1 Parent(s): fc9a5c9

rearrange app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -16
app.py CHANGED
@@ -111,25 +111,23 @@ net = load_u2net()
111
  inpainting_pipeline = load_inpainting_pipeline()
112
  st.title("Stable Fashion Huggingface Spaces")
113
  file_name = st.file_uploader("Upload a clear full length picture of yourself, preferably in a less noisy background")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
 
116
  if file_name is not None:
117
- stable_fashion_args = StableFashionCLIArgs()
118
- stable_fashion_args.image = file_name
119
- body_part = st.radio("Would you like to try clothes on your upper body (such as shirts, kurtas etc) or lower (Jeans, Pants etc)? ", ('Upper', 'Lower'))
120
- stable_fashion_args.part = body_part
121
- resolution = st.radio("Which resolution would you like to get the resulting picture in? (Keep in mind, higher the resolution, higher the queue times)", (128, 256, 512))
122
- stable_fashion_args.resolution = resolution
123
- rembg_status = st.radio("Would you like to remove background in your image before putting new clothes on you? (Sometimes it results in better images)", ("Yes", "No"), index=1)
124
- stable_fashion_args.rembg = (rembg_status == "Yes")
125
- guidance_scale = st.slider("Select a guidance scale. 7.5 gives the best results.", 1.0, 15.0, value=7.5)
126
- stable_fashion_args.guidance_scale = guidance_scale
127
- prompt = st.text_input('Write the description of cloth you want to try', 'a bright yellow t shirt')
128
- stable_fashion_args.prompt = prompt
129
-
130
- num_steps = st.slider("No. of inference steps for the diffusion process", 5, 50, value=25)
131
-
132
-
133
  result_image = process_image(stable_fashion_args, inpainting_pipeline, net)
134
  st.image(result_image, caption='Result')
135
 
 
111
  inpainting_pipeline = load_inpainting_pipeline()
112
  st.title("Stable Fashion Huggingface Spaces")
113
  file_name = st.file_uploader("Upload a clear full length picture of yourself, preferably in a less noisy background")
114
+ stable_fashion_args = StableFashionCLIArgs()
115
+ stable_fashion_args.image = file_name
116
+ body_part = st.radio("Would you like to try clothes on your upper body (such as shirts, kurtas etc) or lower (Jeans, Pants etc)? ", ('Upper', 'Lower'))
117
+ stable_fashion_args.part = body_part
118
+ resolution = st.radio("Which resolution would you like to get the resulting picture in? (Keep in mind, higher the resolution, higher the queue times)", (128, 256, 512))
119
+ stable_fashion_args.resolution = resolution
120
+ rembg_status = st.radio("Would you like to remove background in your image before putting new clothes on you? (Sometimes it results in better images)", ("Yes", "No"), index=1)
121
+ stable_fashion_args.rembg = (rembg_status == "Yes")
122
+ guidance_scale = st.slider("Select a guidance scale. 7.5 gives the best results.", 1.0, 15.0, value=7.5)
123
+ stable_fashion_args.guidance_scale = guidance_scale
124
+ prompt = st.text_input('Write the description of cloth you want to try', 'a bright yellow t shirt')
125
+ stable_fashion_args.prompt = prompt
126
+
127
+ num_steps = st.slider("No. of inference steps for the diffusion process", 5, 50, value=25)
128
 
129
 
130
  if file_name is not None:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  result_image = process_image(stable_fashion_args, inpainting_pipeline, net)
132
  st.image(result_image, caption='Result')
133