Matheus Ribeiro de Oliveira commited on
Commit
20e4b5c
1 Parent(s): e53edcb

add input image

Browse files
Files changed (2) hide show
  1. app.py +6 -6
  2. scott.png +0 -0
app.py CHANGED
@@ -152,14 +152,14 @@ if __name__ == "__main__":
152
  Finally, choose the model on the Dropdown within each tab and click on 'Generate'! Enjoy the App!
153
  """)
154
 
155
- #original_image_path = ""#"inputs/demo/milton.png" # Select input image path here
156
  # original_image_path = "outputs/txt2img/generated_input.png" # for txt2img generated input image
157
- #input_mask_path = "inputs/gradio_masks/jessi_mask.png" # Optional, make sure it matches the input image
158
- #original_image = Image.open(original_image_path)
159
 
160
  with gr.Row():
161
  with gr.Column():
162
- input_image = gr.Image(label="Input Image", sources='upload', type="pil", interactive=True)
163
  with gr.Column():
164
  output_image = gr.Image(label="Generated Image", type="pil")
165
 
@@ -170,7 +170,7 @@ if __name__ == "__main__":
170
  with gr.Column():
171
 
172
  gr.Markdown("Type image coordinates manually or click on the image directly:")
173
- coord_input = gr.Textbox(label="Pixel Coordinates (x,y), Format x1,y1; x2,y2 ...")
174
  reset_button = gr.Button("Reset coordinates")
175
  reload_image_button = gr.Button("Clear Image")
176
  reload_output_button = gr.Button("Load Output")
@@ -198,7 +198,7 @@ if __name__ == "__main__":
198
  Here is the mask uploaded directly from the gradio script, if you wish to change it,
199
  use the Mask Generation Preview Tab and click the 'Load Preview Mask' button.
200
  """)
201
- mask_image = gr.Image(label="Input Mask (Optional)", sources='upload', type="pil")
202
 
203
  with gr.Tab("Inpainting - Object Replacement"):
204
  tab_task_selector_2 = gr.Dropdown(["Stable Diffusion with ControlNet Inpainting",
 
152
  Finally, choose the model on the Dropdown within each tab and click on 'Generate'! Enjoy the App!
153
  """)
154
 
155
+ original_image_path = "scott.png" # Select input image path here
156
  # original_image_path = "outputs/txt2img/generated_input.png" # for txt2img generated input image
157
+ input_mask_path = "scott.png" # Optional, make sure it matches the input image
158
+ original_image = Image.open(original_image_path)
159
 
160
  with gr.Row():
161
  with gr.Column():
162
+ input_image = gr.Image(label="Input Image", sources='upload', type="pil", value=original_image_path, interactive=True)
163
  with gr.Column():
164
  output_image = gr.Image(label="Generated Image", type="pil")
165
 
 
170
  with gr.Column():
171
 
172
  gr.Markdown("Type image coordinates manually or click on the image directly:")
173
+ coord_input = gr.Textbox(label="Pixel Coordinates (x,y), Format x1,y1; x2,y2 ...", value="")
174
  reset_button = gr.Button("Reset coordinates")
175
  reload_image_button = gr.Button("Clear Image")
176
  reload_output_button = gr.Button("Load Output")
 
198
  Here is the mask uploaded directly from the gradio script, if you wish to change it,
199
  use the Mask Generation Preview Tab and click the 'Load Preview Mask' button.
200
  """)
201
+ mask_image = gr.Image(label="Input Mask (Optional)", sources='upload', type="pil", value=input_mask_path)
202
 
203
  with gr.Tab("Inpainting - Object Replacement"):
204
  tab_task_selector_2 = gr.Dropdown(["Stable Diffusion with ControlNet Inpainting",
scott.png ADDED