Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -68,8 +68,10 @@ def infer(
|
|
68 |
seed=4,
|
69 |
guidance_scale=7.5,
|
70 |
lora_scale=0.5,
|
71 |
-
use_control_net=False, # Добавляем параметр для управления включением ControlNet
|
72 |
-
#
|
|
|
|
|
73 |
progress=gr.Progress(track_tqdm=True)
|
74 |
):
|
75 |
|
@@ -97,14 +99,18 @@ def infer(
|
|
97 |
'generator': generator,
|
98 |
}
|
99 |
|
100 |
-
if use_control_net: # Если ControlNet включен
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
|
|
103 |
|
104 |
return pipe(**params).images[0]
|
105 |
|
106 |
examples = [
|
107 |
-
"A young man in anime style. The image is characterized by high definition and resolution. Handsome, thoughtful man, attentive eyes. The man is depicted in the foreground, close-up or in the middle. High-quality images of the face, eyes, nose, lips, hands
|
108 |
"Astronaut in a jungle, cold color palette, muted colors, detailed, 8k.",
|
109 |
"An astronaut riding a green horse.",
|
110 |
]
|
@@ -342,14 +348,6 @@ with gr.Blocks(css=css) as demo:
|
|
342 |
outputs=output,
|
343 |
)
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
gr.Examples(examples=examples, inputs=[prompt])
|
354 |
gr.Examples(examples=examples_negative, inputs=[negative_prompt])
|
355 |
|
@@ -370,13 +368,14 @@ with gr.Blocks(css=css) as demo:
|
|
370 |
seed,
|
371 |
guidance_scale,
|
372 |
lora_scale,
|
373 |
-
use_control_net,
|
374 |
-
#
|
|
|
|
|
375 |
],
|
376 |
outputs=[result],
|
377 |
)
|
378 |
|
379 |
if __name__ == "__main__":
|
380 |
demo.launch()
|
381 |
-
|
382 |
|
|
|
68 |
seed=4,
|
69 |
guidance_scale=7.5,
|
70 |
lora_scale=0.5,
|
71 |
+
# use_control_net=False, # Добавляем параметр для управления включением ControlNet
|
72 |
+
# control_strength=0.5,
|
73 |
+
# use_ip_adapter=False, # Добавляем параметр для управления включением Ip_Adapter
|
74 |
+
# ip_adapter_scale=0.5,
|
75 |
progress=gr.Progress(track_tqdm=True)
|
76 |
):
|
77 |
|
|
|
99 |
'generator': generator,
|
100 |
}
|
101 |
|
102 |
+
# if use_control_net: # Если ControlNet включен
|
103 |
+
# params['control_net'] = True # Включаем использование ControlNet
|
104 |
+
# params['control_strength'] = control_strength # Устанавливаем вес ControlNet
|
105 |
+
|
106 |
+
# if use_ip_adapter: # Если Ip_Adapter включен
|
107 |
+
# params['ip_adapter'] = True # Включаем использование Ip_Adapter
|
108 |
+
# params['ip_adapter_scale'] = ip_adapter_scale # Устанавливаем вес Ip_Adapter
|
109 |
|
110 |
return pipe(**params).images[0]
|
111 |
|
112 |
examples = [
|
113 |
+
"A young man in anime style. The image is characterized by high definition and resolution. Handsome, thoughtful man, attentive eyes. The man is depicted in the foreground, close-up or in the middle. High-quality images of the face, eyes, nose, lips, hands and clothes. The background and background are blurred and indistinct. The play of light and shadow is visible on the face and clothes.",
|
114 |
"Astronaut in a jungle, cold color palette, muted colors, detailed, 8k.",
|
115 |
"An astronaut riding a green horse.",
|
116 |
]
|
|
|
348 |
outputs=output,
|
349 |
)
|
350 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
gr.Examples(examples=examples, inputs=[prompt])
|
352 |
gr.Examples(examples=examples_negative, inputs=[negative_prompt])
|
353 |
|
|
|
368 |
seed,
|
369 |
guidance_scale,
|
370 |
lora_scale,
|
371 |
+
# use_control_net,
|
372 |
+
# control_strength,
|
373 |
+
# use_ip_adapter,
|
374 |
+
# ip_adapter_scale,
|
375 |
],
|
376 |
outputs=[result],
|
377 |
)
|
378 |
|
379 |
if __name__ == "__main__":
|
380 |
demo.launch()
|
|
|
381 |
|