Spaces:
Running
on
Zero
Running
on
Zero
add step
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def sanitize_prompt(prompt):
|
|
28 |
|
29 |
|
30 |
@spaces.GPU(duration=160)
|
31 |
-
def process_images(image, image2=None,prompt="a girl",strength=0.75,seed=0,progress=gr.Progress(track_tqdm=True)):
|
32 |
print("start process_images")
|
33 |
progress(0, desc="Starting")
|
34 |
# I'm not sure when this happen
|
@@ -67,7 +67,7 @@ def process_images(image, image2=None,prompt="a girl",strength=0.75,seed=0,progr
|
|
67 |
# TODO support mask
|
68 |
return output.images[0]
|
69 |
|
70 |
-
output = process_img2img(image["background"],mask,prompt,strength,seed)
|
71 |
|
72 |
print("end process_images")
|
73 |
return output
|
@@ -115,8 +115,9 @@ with gr.Blocks(css=css, elem_id="demo-container") as demo:
|
|
115 |
image_mask = gr.Image(sources=['upload','clipboard'], elem_id="mask_upload", type="pil", label="Mask_Upload",height=400, value=None)
|
116 |
with gr.Accordion(label="Advanced Settings", open=False):
|
117 |
with gr.Row( equal_height=True):
|
118 |
-
strength = gr.Number(value=0.75, minimum=0, maximum=
|
119 |
seed = gr.Number(value=0, minimum=0, step=1, label="seed")
|
|
|
120 |
#models = ["black-forest-labs/FLUX.1-schnell"]
|
121 |
#inpaint_model = gr.Dropdown(label="modes", choices=models, value="black-forest-labs/FLUX.1-schnell")
|
122 |
id_input=gr.Text(label="Name", visible=False)
|
@@ -127,7 +128,7 @@ with gr.Blocks(css=css, elem_id="demo-container") as demo:
|
|
127 |
|
128 |
|
129 |
|
130 |
-
btn.click(fn=process_images, inputs=[image, image_mask,prompt,strength,seed], outputs =image_out, api_name='infer')
|
131 |
gr.Examples(
|
132 |
examples=[
|
133 |
#["images/00547245_99.jpg", "images/00547245_99_mask.jpg","a beautiful girl,eyes closed",0.8,"images/00547245.jpg"],
|
|
|
28 |
|
29 |
|
30 |
@spaces.GPU(duration=160)
|
31 |
+
def process_images(image, image2=None,prompt="a girl",strength=0.75,seed=0,inference_step=4,progress=gr.Progress(track_tqdm=True)):
|
32 |
print("start process_images")
|
33 |
progress(0, desc="Starting")
|
34 |
# I'm not sure when this happen
|
|
|
67 |
# TODO support mask
|
68 |
return output.images[0]
|
69 |
|
70 |
+
output = process_img2img(image["background"],mask,prompt,strength,seed,inference_step)
|
71 |
|
72 |
print("end process_images")
|
73 |
return output
|
|
|
115 |
image_mask = gr.Image(sources=['upload','clipboard'], elem_id="mask_upload", type="pil", label="Mask_Upload",height=400, value=None)
|
116 |
with gr.Accordion(label="Advanced Settings", open=False):
|
117 |
with gr.Row( equal_height=True):
|
118 |
+
strength = gr.Number(value=0.75, minimum=0, maximum=0.75, step=0.01, label="strength")
|
119 |
seed = gr.Number(value=0, minimum=0, step=1, label="seed")
|
120 |
+
inference_step = gr.Number(value=4, minimum=1, step=4, label="inference_step")
|
121 |
#models = ["black-forest-labs/FLUX.1-schnell"]
|
122 |
#inpaint_model = gr.Dropdown(label="modes", choices=models, value="black-forest-labs/FLUX.1-schnell")
|
123 |
id_input=gr.Text(label="Name", visible=False)
|
|
|
128 |
|
129 |
|
130 |
|
131 |
+
btn.click(fn=process_images, inputs=[image, image_mask,prompt,strength,seed,inference_step], outputs =image_out, api_name='infer')
|
132 |
gr.Examples(
|
133 |
examples=[
|
134 |
#["images/00547245_99.jpg", "images/00547245_99_mask.jpg","a beautiful girl,eyes closed",0.8,"images/00547245.jpg"],
|