DamarJati commited on
Commit
62166ac
·
verified ·
1 Parent(s): 8fab564

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py CHANGED
@@ -17,6 +17,8 @@ from PIL import Image
17
  models = ["Model A", "Model B", "Model C"]
18
  vae = ["VAE A", "VAE B", "VAE C"]
19
  controlnet_types = ["Canny", "Depth", "Normal", "Pose"]
 
 
20
 
21
  # Fungsi placeholder
22
  def load_model(selected_model):
@@ -314,6 +316,26 @@ with gr.Blocks(css= "style.css") as app:
314
 
315
  controlnet_button.click(fn=controlnet_process_func, inputs=[controlnet_image_input, controlnet_dropdown, model_dropdown, vae_dropdown], outputs=controlnet_output_image)
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
 
318
  # Tab untuk Describe
319
  with gr.Tab("Describe"):
 
17
  models = ["Model A", "Model B", "Model C"]
18
  vae = ["VAE A", "VAE B", "VAE C"]
19
  controlnet_types = ["Canny", "Depth", "Normal", "Pose"]
20
+ schedulers = ["Euler", "LMS", "DDIM"]
21
+
22
 
23
  # Fungsi placeholder
24
  def load_model(selected_model):
 
316
 
317
  controlnet_button.click(fn=controlnet_process_func, inputs=[controlnet_image_input, controlnet_dropdown, model_dropdown, vae_dropdown], outputs=controlnet_output_image)
318
 
319
+ # Tab untuk Intpainting
320
+ with gr.Tab ("Inpainting"):
321
+ with gr.Row():
322
+ with gr.Column():
323
+ image = gr.Image(source='upload', tool='sketch', elem_id="image_upload", type="pil", label="Upload",height=400)
324
+ btn = gr.Button("Inpaint!", elem_id="run_button")
325
+ prompt = gr.Textbox(placeholder="Your prompt (what you want in place of what is erased)", show_label=False, elem_id="prompt")
326
+ negative_prompt = gr.Textbox(label="negative_prompt", placeholder="Your negative prompt", info="what you don't want to see in the image")
327
+ guidance_scale = gr.Number(value=7.5, minimum=1.0, maximum=20.0, step=0.1, label="guidance_scale")
328
+ steps = gr.Number(value=20, minimum=10, maximum=30, step=1, label="steps")
329
+ strength = gr.Number(value=0.99, minimum=0.01, maximum=1.0, step=0.01, label="strength")
330
+ scheduler = gr.Dropdown(label="Schedulers", choices=schedulers, value="EulerDiscreteScheduler")
331
+ with gr.Column():
332
+ image_out = gr.Image(label="Output", elem_id="output-img")
333
+
334
+ btn.click(fn=predict, inputs=[image, prompt, negative_prompt, guidance_scale, steps, strength, scheduler], outputs=[image_out, share_btn_container])
335
+ prompt.submit(fn=predict, inputs=[image, prompt, negative_prompt, guidance_scale, steps, strength, scheduler], outputs=[image_out, share_btn_container])
336
+
337
+
338
+
339
 
340
  # Tab untuk Describe
341
  with gr.Tab("Describe"):