Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -151,9 +151,6 @@ def infer(
|
|
| 151 |
controlnet_changed = False
|
| 152 |
|
| 153 |
if cn_enable:
|
| 154 |
-
print(cn_mode)
|
| 155 |
-
print(dict_controlnet)
|
| 156 |
-
print(pipe.controlnet._name_or_path)
|
| 157 |
if dict_controlnet[cn_mode] != pipe.controlnet._name_or_path:
|
| 158 |
controlnet = ControlNetModel.from_pretrained(
|
| 159 |
dict_controlnet[cn_mode],
|
|
@@ -204,6 +201,7 @@ def infer(
|
|
| 204 |
params['controlnet_conditioning_scale'] = cn_strength
|
| 205 |
if cn_mode == 'edge_detection':
|
| 206 |
control_image = map_edge_detection(cn_image)
|
|
|
|
| 207 |
elif cn_mode == 'scribble':
|
| 208 |
control_image = map_scribble(cn_image)
|
| 209 |
params['control_image'] = control_image
|
|
@@ -293,6 +291,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 293 |
cn_strength = gr.Slider(0, 2, value=0.8, step=0.1, label="Control strength", interactive=True)
|
| 294 |
cn_mode = gr.Dropdown(
|
| 295 |
choices=["edge_detection", "scribble"],
|
|
|
|
| 296 |
label="Work regime",
|
| 297 |
interactive=True,
|
| 298 |
)
|
|
|
|
| 151 |
controlnet_changed = False
|
| 152 |
|
| 153 |
if cn_enable:
|
|
|
|
|
|
|
|
|
|
| 154 |
if dict_controlnet[cn_mode] != pipe.controlnet._name_or_path:
|
| 155 |
controlnet = ControlNetModel.from_pretrained(
|
| 156 |
dict_controlnet[cn_mode],
|
|
|
|
| 201 |
params['controlnet_conditioning_scale'] = cn_strength
|
| 202 |
if cn_mode == 'edge_detection':
|
| 203 |
control_image = map_edge_detection(cn_image)
|
| 204 |
+
print(type(control_image))
|
| 205 |
elif cn_mode == 'scribble':
|
| 206 |
control_image = map_scribble(cn_image)
|
| 207 |
params['control_image'] = control_image
|
|
|
|
| 291 |
cn_strength = gr.Slider(0, 2, value=0.8, step=0.1, label="Control strength", interactive=True)
|
| 292 |
cn_mode = gr.Dropdown(
|
| 293 |
choices=["edge_detection", "scribble"],
|
| 294 |
+
value="edge_detection",
|
| 295 |
label="Work regime",
|
| 296 |
interactive=True,
|
| 297 |
)
|