Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,8 @@ article = """
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
def images(text, input_image, pictures):
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
# Gradio
|
| 20 |
with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.orange, secondary_hue=gr.themes.colors.orange)) as demo:
|
|
@@ -26,14 +27,16 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.orange, seco
|
|
| 26 |
# input images
|
| 27 |
image_input_1 = gr.Image(label="Картинка", type="filepath")
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
# generate
|
|
@@ -46,7 +49,7 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.orange, seco
|
|
| 46 |
# output image
|
| 47 |
# add gallery of 20 pictures here
|
| 48 |
#output_image = gr.Image(label="Output Image", sources='upload')
|
| 49 |
-
gallery = gr.Gallery(label='
|
| 50 |
|
| 51 |
# click
|
| 52 |
generate_button.click(
|
|
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
def images(text, input_image, pictures):
|
| 17 |
+
if input_image:
|
| 18 |
+
return [input_image] * pictures
|
| 19 |
|
| 20 |
# Gradio
|
| 21 |
with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.orange, secondary_hue=gr.themes.colors.orange)) as demo:
|
|
|
|
| 27 |
# input images
|
| 28 |
image_input_1 = gr.Image(label="Картинка", type="filepath")
|
| 29 |
|
| 30 |
+
with gr.Accordion(label="Настройки", open=False):
|
| 31 |
+
# text prompt
|
| 32 |
+
pictures_slider = gr.Slider(
|
| 33 |
+
label="Количество картинок", minimum=1.0, maximum=20.0, value=10, step=1
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
prompt_input = gr.Textbox(
|
| 37 |
+
label="Введите что-то", placeholder="Напишите сюда что-нибудь"
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
|
| 41 |
|
| 42 |
# generate
|
|
|
|
| 49 |
# output image
|
| 50 |
# add gallery of 20 pictures here
|
| 51 |
#output_image = gr.Image(label="Output Image", sources='upload')
|
| 52 |
+
gallery = gr.Gallery(label='Галерея', columns=4, rows=5, scale=2)
|
| 53 |
|
| 54 |
# click
|
| 55 |
generate_button.click(
|