Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ scheduler_dict = {
|
|
| 29 |
|
| 30 |
css = """
|
| 31 |
.toolbutton {
|
| 32 |
-
margin-
|
| 33 |
max-width: 2.5em;
|
| 34 |
min-width: 2.5em !important;
|
| 35 |
height: 2.5em;
|
|
@@ -48,12 +48,11 @@ EXAMPLES = [ # prompt, first frame, width, height, center crop, seed
|
|
| 48 |
["์ฝ์์ ๋
น์๋ด๋ฆฌ๋ ์์ด์คํฌ๋ฆผ.", "example/example_04.png"],
|
| 49 |
]
|
| 50 |
|
| 51 |
-
|
| 52 |
EXAMPLES_HIDDEN = {
|
| 53 |
-
"
|
| 54 |
-
"
|
| 55 |
-
"
|
| 56 |
-
"
|
| 57 |
}
|
| 58 |
|
| 59 |
def update_and_resize_image(input_image_path, height_slider, width_slider, center_crop):
|
|
@@ -211,7 +210,7 @@ def animate(
|
|
| 211 |
)
|
| 212 |
|
| 213 |
# Translate Korean prompt to English
|
| 214 |
-
translated_prompt = translator(prompt_textbox
|
| 215 |
|
| 216 |
sample = pipeline(
|
| 217 |
translated_prompt,
|
|
@@ -272,12 +271,12 @@ def ui():
|
|
| 272 |
with gr.Column():
|
| 273 |
with gr.Row():
|
| 274 |
sampler_dropdown = gr.Dropdown(label="Sampling method", choices=list(scheduler_dict.keys()), value=list(scheduler_dict.keys())[0])
|
| 275 |
-
sample_step_slider = gr.Slider(label="Sampling steps", value=
|
| 276 |
|
| 277 |
with gr.Row():
|
| 278 |
center_crop = gr.Checkbox(label="Center Crop the Image", value=True)
|
| 279 |
-
width_slider = gr.Slider(label="Width", value=
|
| 280 |
-
height_slider = gr.Slider(label="Height", value=
|
| 281 |
with gr.Row():
|
| 282 |
txt_cfg_scale_slider = gr.Slider(label="Text CFG Scale", value=7.5, minimum=1.0, maximum=20.0, step=0.5)
|
| 283 |
img_cfg_scale_slider = gr.Slider(label="Image CFG Scale", value=1.0, minimum=1.0, maximum=20.0, step=0.5)
|
|
|
|
| 29 |
|
| 30 |
css = """
|
| 31 |
.toolbutton {
|
| 32 |
+
margin-bottom: 0em 0em 0em 0em;
|
| 33 |
max-width: 2.5em;
|
| 34 |
min-width: 2.5em !important;
|
| 35 |
height: 2.5em;
|
|
|
|
| 48 |
["์ฝ์์ ๋
น์๋ด๋ฆฌ๋ ์์ด์คํฌ๋ฆผ.", "example/example_04.png"],
|
| 49 |
]
|
| 50 |
|
|
|
|
| 51 |
EXAMPLES_HIDDEN = {
|
| 52 |
+
"์ค๋ก๋ผ๊ฐ ํ๋์ ์๋ ๋ ๋ฎ์ธ ๋
์ ํ์๋ฉ์ค.": ["example/example_01.png", 512, 512, True, 21800],
|
| 53 |
+
"๋ถ๊ฝ๋์ด.": ["example/example_02.png", 512, 512, True, 21800],
|
| 54 |
+
"์ฐํธ์ด๋ฅผ ํค์์น๋ ํฐ๋๊ฐ๋ฆฌ.": ["example/example_03.png", 512, 512, True, 75692375],
|
| 55 |
+
"์ฝ์์ ๋
น์๋ด๋ฆฌ๋ ์์ด์คํฌ๋ฆผ.": ["example/example_04.png", 512, 512, True, 21800]
|
| 56 |
}
|
| 57 |
|
| 58 |
def update_and_resize_image(input_image_path, height_slider, width_slider, center_crop):
|
|
|
|
| 210 |
)
|
| 211 |
|
| 212 |
# Translate Korean prompt to English
|
| 213 |
+
translated_prompt = translator(prompt_textbox)[0]['translation_text']
|
| 214 |
|
| 215 |
sample = pipeline(
|
| 216 |
translated_prompt,
|
|
|
|
| 271 |
with gr.Column():
|
| 272 |
with gr.Row():
|
| 273 |
sampler_dropdown = gr.Dropdown(label="Sampling method", choices=list(scheduler_dict.keys()), value=list(scheduler_dict.keys())[0])
|
| 274 |
+
sample_step_slider = gr.Slider(label="Sampling steps", value=50, minimum=10, maximum=250, step=1)
|
| 275 |
|
| 276 |
with gr.Row():
|
| 277 |
center_crop = gr.Checkbox(label="Center Crop the Image", value=True)
|
| 278 |
+
width_slider = gr.Slider(label="Width", value=256, minimum=0, maximum=512, step=64)
|
| 279 |
+
height_slider = gr.Slider(label="Height", value=256, minimum=0, maximum=512, step=64)
|
| 280 |
with gr.Row():
|
| 281 |
txt_cfg_scale_slider = gr.Slider(label="Text CFG Scale", value=7.5, minimum=1.0, maximum=20.0, step=0.5)
|
| 282 |
img_cfg_scale_slider = gr.Slider(label="Image CFG Scale", value=1.0, minimum=1.0, maximum=20.0, step=0.5)
|