Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -89,6 +89,7 @@ def infer(
|
|
89 |
seed=4,
|
90 |
guidance_scale=7.5,
|
91 |
lora_scale=0.5,
|
|
|
92 |
use_control_net=False, # Параметр для включения ControlNet
|
93 |
control_strength=0.5, # Сила влияния ControlNet
|
94 |
source_image=None, # Исходное изображение
|
@@ -145,7 +146,7 @@ def infer(
|
|
145 |
negative_prompt_embeds=negative_prompt_embeds,
|
146 |
image=source_image,
|
147 |
control_image=control_image,
|
148 |
-
strength=
|
149 |
width=width,
|
150 |
height=height,
|
151 |
num_inference_steps=num_inference_steps,
|
@@ -289,7 +290,16 @@ with gr.Blocks(css=css) as demo:
|
|
289 |
value=False,
|
290 |
)
|
291 |
|
292 |
-
with gr.Column(visible=False) as
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
control_strength = gr.Slider(
|
294 |
label="Control Strength",
|
295 |
minimum=0.0,
|
@@ -297,7 +307,7 @@ with gr.Blocks(css=css) as demo:
|
|
297 |
value=0.5,
|
298 |
step=0.05,
|
299 |
)
|
300 |
-
|
301 |
control_mode = gr.Dropdown(
|
302 |
label="Control Mode",
|
303 |
choices=[
|
@@ -313,7 +323,7 @@ with gr.Blocks(css=css) as demo:
|
|
313 |
use_control_net.change(
|
314 |
fn=lambda x: gr.Row.update(visible=x),
|
315 |
inputs=use_control_net,
|
316 |
-
outputs=
|
317 |
)
|
318 |
# --------------------------------------------------------------------------------------
|
319 |
|
@@ -336,10 +346,11 @@ with gr.Blocks(css=css) as demo:
|
|
336 |
seed,
|
337 |
guidance_scale,
|
338 |
lora_scale,
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
|
|
343 |
],
|
344 |
outputs=[result],
|
345 |
)
|
|
|
89 |
seed=4,
|
90 |
guidance_scale=7.5,
|
91 |
lora_scale=0.5,
|
92 |
+
strength_cn=0.5, # Коэфф. зашумления
|
93 |
use_control_net=False, # Параметр для включения ControlNet
|
94 |
control_strength=0.5, # Сила влияния ControlNet
|
95 |
source_image=None, # Исходное изображение
|
|
|
146 |
negative_prompt_embeds=negative_prompt_embeds,
|
147 |
image=source_image,
|
148 |
control_image=control_image,
|
149 |
+
strength=strength_cn, # Коэфф. зашумления, чем больше, тем больше меняется результирующее изображение относитенльно исходного
|
150 |
width=width,
|
151 |
height=height,
|
152 |
num_inference_steps=num_inference_steps,
|
|
|
290 |
value=False,
|
291 |
)
|
292 |
|
293 |
+
with gr.Column(visible=False) as control_net_options_2:
|
294 |
+
strength_cn = gr.Slider(
|
295 |
+
label="Strength",
|
296 |
+
minimum=0.0,
|
297 |
+
maximum=1.0,
|
298 |
+
value=0.5,
|
299 |
+
step=0.05,
|
300 |
+
)
|
301 |
+
|
302 |
+
with gr.Column(visible=False) as control_net_options_1:
|
303 |
control_strength = gr.Slider(
|
304 |
label="Control Strength",
|
305 |
minimum=0.0,
|
|
|
307 |
value=0.5,
|
308 |
step=0.05,
|
309 |
)
|
310 |
+
|
311 |
control_mode = gr.Dropdown(
|
312 |
label="Control Mode",
|
313 |
choices=[
|
|
|
323 |
use_control_net.change(
|
324 |
fn=lambda x: gr.Row.update(visible=x),
|
325 |
inputs=use_control_net,
|
326 |
+
outputs=[control_net_options_1, control_net_options_2]
|
327 |
)
|
328 |
# --------------------------------------------------------------------------------------
|
329 |
|
|
|
346 |
seed,
|
347 |
guidance_scale,
|
348 |
lora_scale,
|
349 |
+
strength_cn, # Коэфф. зашумления
|
350 |
+
use_control_net, # Чекбокс для ControlNet
|
351 |
+
control_strength, # Контроль силы
|
352 |
+
source_image, # Исходное изображение
|
353 |
+
control_image, # Контрольное изображение
|
354 |
],
|
355 |
outputs=[result],
|
356 |
)
|