Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -24,9 +24,9 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_in
|
|
24 |
|
25 |
# νκΈ μ
λ ₯ κ°μ§ λ° λ²μ
|
26 |
if any('\uAC00' <= char <= '\uD7A3' for char in prompt):
|
27 |
-
print("
|
28 |
translated_prompt = translator(prompt, max_length=512)[0]['translation_text']
|
29 |
-
print("
|
30 |
prompt = translated_prompt
|
31 |
|
32 |
image = pipe(
|
@@ -40,13 +40,13 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_in
|
|
40 |
return image, seed
|
41 |
|
42 |
examples = [
|
43 |
-
["
|
44 |
-
["
|
45 |
-
["
|
46 |
-
["
|
47 |
-
["
|
48 |
-
["
|
49 |
-
["
|
50 |
]
|
51 |
|
52 |
css = """
|
@@ -59,32 +59,32 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
|
59 |
with gr.Column(elem_id="col-container"):
|
60 |
with gr.Row():
|
61 |
prompt = gr.Text(
|
62 |
-
label="
|
63 |
show_label=False,
|
64 |
max_lines=1,
|
65 |
-
placeholder="
|
66 |
container=False,
|
67 |
elem_id="prompt"
|
68 |
)
|
69 |
|
70 |
-
run_button = gr.Button("
|
71 |
|
72 |
-
result = gr.Image(label="
|
73 |
|
74 |
-
with gr.Accordion("
|
75 |
seed = gr.Slider(
|
76 |
-
label="
|
77 |
minimum=0,
|
78 |
maximum=MAX_SEED,
|
79 |
step=1,
|
80 |
value=0,
|
81 |
)
|
82 |
|
83 |
-
randomize_seed = gr.Checkbox(label="
|
84 |
|
85 |
with gr.Row():
|
86 |
width = gr.Slider(
|
87 |
-
label="
|
88 |
minimum=256,
|
89 |
maximum=MAX_IMAGE_SIZE,
|
90 |
step=32,
|
@@ -92,7 +92,7 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
|
92 |
)
|
93 |
|
94 |
height = gr.Slider(
|
95 |
-
label="
|
96 |
minimum=256,
|
97 |
maximum=MAX_IMAGE_SIZE,
|
98 |
step=32,
|
@@ -101,7 +101,7 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
|
101 |
|
102 |
with gr.Row():
|
103 |
num_inference_steps = gr.Slider(
|
104 |
-
label="
|
105 |
minimum=1,
|
106 |
maximum=50,
|
107 |
step=1,
|
@@ -123,4 +123,4 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
|
123 |
outputs=[result, seed]
|
124 |
)
|
125 |
|
126 |
-
demo.launch()
|
|
|
24 |
|
25 |
# νκΈ μ
λ ₯ κ°μ§ λ° λ²μ
|
26 |
if any('\uAC00' <= char <= '\uD7A3' for char in prompt):
|
27 |
+
print("νκ΅μ΄ ν둬ννΈ λ²μ μ€...")
|
28 |
translated_prompt = translator(prompt, max_length=512)[0]['translation_text']
|
29 |
+
print("λ²μλ ν둬ννΈ:", translated_prompt)
|
30 |
prompt = translated_prompt
|
31 |
|
32 |
image = pipe(
|
|
|
40 |
return image, seed
|
41 |
|
42 |
examples = [
|
43 |
+
["[μμ: νλμ] [λμμΈ μ»¨μ
: λ‘μΌ] [ν
μ€νΈ: 'μΈκ³'] [λ°°κ²½: νλμ]μ μλ‘μ΄ λ‘κ³ λ§λ€κΈ°"],
|
44 |
+
["[μμ: νλμ] [λμμΈ μ»¨μ
: μ°μ£Ό] [ν
μ€νΈ: 'μ½μΉ΄μ½λΌ'] [λ°°κ²½: λ€μ±λ‘μ΄ μμ]μ μλ‘μ΄ λ‘κ³ λ§λ€κΈ°"],
|
45 |
+
["λ°©ν¨ μμ μλ κ°λ¨ν λ―Έλμ μΈ μΉ΄λ―ΈμΉ΄μ λλ‘ λ‘κ³ , λ―Έλλ©λ¦¬μ€ν±, 벑ν°, 2D, λ¨μν μ , ν°μ λ°°κ²½ --v 4"],
|
46 |
+
["[μμ: νλμ] [λμμΈ μ»¨μ
: μ°] [ν
μ€νΈ: 'abc@gmail.com'] [λ°°κ²½: λΉ¨κ°μ]μ μλ‘μ΄ λ‘κ³ λ§λ€κΈ°"],
|
47 |
+
["[μμ: νλμ] [λμμΈ μ»¨μ
: μ¬λ] [ν
μ€νΈ: 'ABC.COM'] [λ°°κ²½: λ
Έλμ]μ μλ‘μ΄ λ‘κ³ λ§λ€κΈ°"],
|
48 |
+
["[μμ: νλμ] [λμμΈ μ»¨μ
: μ§] [ν
μ€νΈ: 'T.010-1234-1234'] [λ°°κ²½: λ€μ±λ‘μ΄ μμ]μ μλ‘μ΄ λ‘κ³ λ§λ€κΈ°"],
|
49 |
+
["[μμ: νλμ] [λμμΈ μ»¨μ
: μ¬μ] [ν
μ€νΈ: 'μΆκ΅¬ ν΄λ½'] [λ°°κ²½: μ΄λ‘μ]μ μλ‘μ΄ λ‘κ³ λ§λ€κΈ°"]
|
50 |
]
|
51 |
|
52 |
css = """
|
|
|
59 |
with gr.Column(elem_id="col-container"):
|
60 |
with gr.Row():
|
61 |
prompt = gr.Text(
|
62 |
+
label="ν둬ννΈ",
|
63 |
show_label=False,
|
64 |
max_lines=1,
|
65 |
+
placeholder="ν둬ννΈλ₯Ό μ
λ ₯νμΈμ",
|
66 |
container=False,
|
67 |
elem_id="prompt"
|
68 |
)
|
69 |
|
70 |
+
run_button = gr.Button("μ€ν", scale=0)
|
71 |
|
72 |
+
result = gr.Image(label="κ²°κ³Ό", show_label=False, elem_id="result")
|
73 |
|
74 |
+
with gr.Accordion("κ³ κΈ μ€μ ", open=False, elem_id="advanced-settings"):
|
75 |
seed = gr.Slider(
|
76 |
+
label="μλ",
|
77 |
minimum=0,
|
78 |
maximum=MAX_SEED,
|
79 |
step=1,
|
80 |
value=0,
|
81 |
)
|
82 |
|
83 |
+
randomize_seed = gr.Checkbox(label="μλ 무μμν", value=True)
|
84 |
|
85 |
with gr.Row():
|
86 |
width = gr.Slider(
|
87 |
+
label="λλΉ",
|
88 |
minimum=256,
|
89 |
maximum=MAX_IMAGE_SIZE,
|
90 |
step=32,
|
|
|
92 |
)
|
93 |
|
94 |
height = gr.Slider(
|
95 |
+
label="λμ΄",
|
96 |
minimum=256,
|
97 |
maximum=MAX_IMAGE_SIZE,
|
98 |
step=32,
|
|
|
101 |
|
102 |
with gr.Row():
|
103 |
num_inference_steps = gr.Slider(
|
104 |
+
label="μΆλ‘ λ¨κ³ μ",
|
105 |
minimum=1,
|
106 |
maximum=50,
|
107 |
step=1,
|
|
|
123 |
outputs=[result, seed]
|
124 |
)
|
125 |
|
126 |
+
demo.launch()
|