Vignesh455 commited on
Commit
ab9b507
·
verified ·
1 Parent(s): 32e5840

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -29,10 +29,10 @@ def predict(dict, prompt="", negative_prompt="", guidance_scale=7.5, steps=20, s
29
  scheduler = getattr(diffusers, scheduler_class_name)
30
  pipe.scheduler = scheduler.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", subfolder="scheduler", **add_kwargs)
31
 
32
- init_image = dict["image"].convert("RGB")
33
- mask = dict["mask"].convert("RGB")
34
 
35
- output = pipe(prompt = prompt, negative_prompt=negative_prompt, image=init_image, mask_image=mask, guidance_scale=guidance_scale, num_inference_steps=int(steps), strength=strength)
36
 
37
  return output.images[0], gr.update(visible=True)
38
 
@@ -88,12 +88,12 @@ with image_blocks as demo:
88
  with gr.Accordion(label="Advanced Settings", open=False):
89
  with gr.Row(equal_height=True):
90
  guidance_scale = gr.Number(value=7.5, minimum=1.0, maximum=20.0, step=0.1, label="guidance_scale")
91
- steps = gr.Number(value=20, minimum=10, maximum=30, step=1, label="steps")
92
  strength = gr.Number(value=0.99, minimum=0.01, maximum=1.0, step=0.01, label="strength")
93
  negative_prompt = gr.Textbox(label="negative_prompt", placeholder="Your negative prompt", info="what you don't want to see in the image")
94
  with gr.Row(equal_height=True):
95
  schedulers = ["DEISMultistepScheduler", "HeunDiscreteScheduler", "EulerDiscreteScheduler", "DPMSolverMultistepScheduler", "DPMSolverMultistepScheduler-Karras", "DPMSolverMultistepScheduler-Karras-SDE"]
96
- scheduler = gr.Dropdown(label="Schedulers", choices=schedulers, value="EulerDiscreteScheduler")
97
 
98
  with gr.Column():
99
  image_out = gr.Image(label="Output", elem_id="output-img", height=400)
 
29
  scheduler = getattr(diffusers, scheduler_class_name)
30
  pipe.scheduler = scheduler.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", subfolder="scheduler", **add_kwargs)
31
 
32
+ init_image = dict["image"]
33
+ mask = dict["mask"]
34
 
35
+ output = pipe(prompt = prompt, negative_prompt=negative_prompt, image=init_image, mask_image=mask, guidance_scale=guidance_scale, num_inference_steps=int(steps), strength=strength, clip_skip=1)
36
 
37
  return output.images[0], gr.update(visible=True)
38
 
 
88
  with gr.Accordion(label="Advanced Settings", open=False):
89
  with gr.Row(equal_height=True):
90
  guidance_scale = gr.Number(value=7.5, minimum=1.0, maximum=20.0, step=0.1, label="guidance_scale")
91
+ steps = gr.Number(value=20, minimum=10, maximum=100, step=1, label="steps")
92
  strength = gr.Number(value=0.99, minimum=0.01, maximum=1.0, step=0.01, label="strength")
93
  negative_prompt = gr.Textbox(label="negative_prompt", placeholder="Your negative prompt", info="what you don't want to see in the image")
94
  with gr.Row(equal_height=True):
95
  schedulers = ["DEISMultistepScheduler", "HeunDiscreteScheduler", "EulerDiscreteScheduler", "DPMSolverMultistepScheduler", "DPMSolverMultistepScheduler-Karras", "DPMSolverMultistepScheduler-Karras-SDE"]
96
+ scheduler = gr.Dropdown(label="Schedulers", choices=schedulers, value="DPMSolverMultistepScheduler-Karras")
97
 
98
  with gr.Column():
99
  image_out = gr.Image(label="Output", elem_id="output-img", height=400)