Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,8 @@ def generate_image(prompt, structure_image, style_image, depth_strength=15, styl
|
|
58 |
style_image=handle_file(style_image_url),
|
59 |
depth_strength=depth_strength,
|
60 |
style_strength=style_strength,
|
61 |
-
api_name="/generate_image"
|
|
|
62 |
)
|
63 |
|
64 |
if isinstance(result, str) and os.path.exists(result):
|
@@ -73,8 +74,8 @@ def generate_image(prompt, structure_image, style_image, depth_strength=15, styl
|
|
73 |
# Примеры для Gradio
|
74 |
examples = [
|
75 |
["", "https://huggingface.co/spaces/multimodalart/flux-style-shaping/resolve/main/mona.png", "https://huggingface.co/spaces/multimodalart/flux-style-shaping/resolve/main/receita-tacos.webp", 15, 0.6],
|
76 |
-
["
|
77 |
-
["
|
78 |
]
|
79 |
|
80 |
output_image = gr.Image(label="Сгенерированное изображение", show_share_button=False)
|
@@ -98,6 +99,7 @@ with gr.Blocks(css=css) as app:
|
|
98 |
inputs=[prompt_input, structure_image, style_image, depth_strength, style_strength],
|
99 |
outputs=[output_image],
|
100 |
fn=generate_image,
|
|
|
101 |
cache_examples=False,
|
102 |
)
|
103 |
|
|
|
58 |
style_image=handle_file(style_image_url),
|
59 |
depth_strength=depth_strength,
|
60 |
style_strength=style_strength,
|
61 |
+
api_name="/generate_image",
|
62 |
+
timeout=3000
|
63 |
)
|
64 |
|
65 |
if isinstance(result, str) and os.path.exists(result):
|
|
|
74 |
# Примеры для Gradio
|
75 |
examples = [
|
76 |
["", "https://huggingface.co/spaces/multimodalart/flux-style-shaping/resolve/main/mona.png", "https://huggingface.co/spaces/multimodalart/flux-style-shaping/resolve/main/receita-tacos.webp", 15, 0.6],
|
77 |
+
["Девочка смотрит на дом, который горит", "https://huggingface.co/spaces/multimodalart/flux-style-shaping/resolve/main/disaster_girl.png", "https://huggingface.co/spaces/multimodalart/flux-style-shaping/resolve/main/abaporu.jpg", 15, 0.15],
|
78 |
+
["Город Истанбул с высоты птичьего полёта", "https://huggingface.co/spaces/multimodalart/flux-style-shaping/resolve/main/natasha.png", "https://huggingface.co/spaces/multimodalart/flux-style-shaping/resolve/main/istambul.jpg", 15, 0.5],
|
79 |
]
|
80 |
|
81 |
output_image = gr.Image(label="Сгенерированное изображение", show_share_button=False)
|
|
|
99 |
inputs=[prompt_input, structure_image, style_image, depth_strength, style_strength],
|
100 |
outputs=[output_image],
|
101 |
fn=generate_image,
|
102 |
+
label="Примеры",
|
103 |
cache_examples=False,
|
104 |
)
|
105 |
|