Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -216,7 +216,7 @@ def resize_to_fit(max_size, original_size):
|
|
| 216 |
return new_width, new_height
|
| 217 |
|
| 218 |
|
| 219 |
-
def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg, model_type):
|
| 220 |
|
| 221 |
max_size = (1500,1500)
|
| 222 |
if prompt in prompt_list:
|
|
@@ -254,7 +254,10 @@ def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg, model_typ
|
|
| 254 |
"intensity" : float(intensity),
|
| 255 |
"width" : 1500,
|
| 256 |
"height" : 1500,
|
| 257 |
-
"refprompt" : refprompt
|
|
|
|
|
|
|
|
|
|
| 258 |
}
|
| 259 |
|
| 260 |
# Select the endpoint based on the model type
|
|
@@ -520,6 +523,11 @@ with block:
|
|
| 520 |
|
| 521 |
with gr.Column():
|
| 522 |
model_type = gr.Dropdown(choices=["realistic","anime"], label="Model Type", value="realistic") # Adding the Dropdown for model selection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 523 |
|
| 524 |
with gr.Column():
|
| 525 |
gr.HTML('''
|
|
@@ -575,7 +583,7 @@ with block:
|
|
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
-
ins = [fore, prompt, intensity, mode, refprompt, isrmbg, model_type]
|
| 579 |
generate_button.click(fn=process_generate, inputs=ins, outputs=[result_gallery])
|
| 580 |
|
| 581 |
|
|
|
|
| 216 |
return new_width, new_height
|
| 217 |
|
| 218 |
|
| 219 |
+
def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg, model_type, , steps, control_strength):
|
| 220 |
|
| 221 |
max_size = (1500,1500)
|
| 222 |
if prompt in prompt_list:
|
|
|
|
| 254 |
"intensity" : float(intensity),
|
| 255 |
"width" : 1500,
|
| 256 |
"height" : 1500,
|
| 257 |
+
"refprompt" : refprompt,
|
| 258 |
+
"first_stage_steps" : int(steps),
|
| 259 |
+
"first_stage_strength" : float(control_strength),
|
| 260 |
+
"second_stage_steps" : 30
|
| 261 |
}
|
| 262 |
|
| 263 |
# Select the endpoint based on the model type
|
|
|
|
| 523 |
|
| 524 |
with gr.Column():
|
| 525 |
model_type = gr.Dropdown(choices=["realistic","anime"], label="Model Type", value="realistic") # Adding the Dropdown for model selection
|
| 526 |
+
|
| 527 |
+
# Adding Advanced Settings for the number of steps and control strength
|
| 528 |
+
with gr.Accordion("Advanced Settings", open=False):
|
| 529 |
+
steps = gr.Slider(label="Number of Steps", minimum=10, maximum=100, value=30, step=1)
|
| 530 |
+
control_strength = gr.Slider(label="Control Strength", minimum=0.1, maximum=1.0, value=0.5, step=0.1)
|
| 531 |
|
| 532 |
with gr.Column():
|
| 533 |
gr.HTML('''
|
|
|
|
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
+
ins = [fore, prompt, intensity, mode, refprompt, isrmbg, model_type, steps, control_strength]
|
| 587 |
generate_button.click(fn=process_generate, inputs=ins, outputs=[result_gallery])
|
| 588 |
|
| 589 |
|