Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -39,74 +39,51 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_in
|
|
39 |
).images[0]
|
40 |
return image, seed
|
41 |
|
|
|
|
|
42 |
examples = [
|
43 |
-
["
|
44 |
-
["
|
45 |
-
["
|
46 |
-
["
|
47 |
-
["
|
48 |
-
["
|
49 |
-
["
|
50 |
]
|
51 |
|
52 |
css = """
|
53 |
-
footer {
|
54 |
-
|
55 |
-
}
|
|
|
|
|
|
|
56 |
"""
|
57 |
|
58 |
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as demo:
|
59 |
-
|
60 |
-
|
|
|
|
|
61 |
prompt = gr.Text(
|
62 |
-
label="
|
63 |
-
|
64 |
-
|
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 |
-
|
84 |
-
|
|
|
|
|
|
|
85 |
with gr.Row():
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
maximum=MAX_IMAGE_SIZE,
|
90 |
-
step=32,
|
91 |
-
value=512,
|
92 |
-
)
|
93 |
-
|
94 |
-
height = gr.Slider(
|
95 |
-
label="๋์ด",
|
96 |
-
minimum=256,
|
97 |
-
maximum=MAX_IMAGE_SIZE,
|
98 |
-
step=32,
|
99 |
-
value=512,
|
100 |
-
)
|
101 |
-
|
102 |
with gr.Row():
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
maximum=50,
|
107 |
-
step=1,
|
108 |
-
value=4,
|
109 |
-
)
|
110 |
|
111 |
gr.Examples(
|
112 |
examples=examples,
|
|
|
39 |
).images[0]
|
40 |
return image, seed
|
41 |
|
42 |
+
# (์ด์ import ๊ตฌ๋ฌธ ๋ฐ ํ์ดํ๋ผ์ธ ์ค์ ์ ์ง)
|
43 |
+
|
44 |
examples = [
|
45 |
+
["[Style: Minimal] [Color: Blue and White] [Concept: Tech Company] [Text: 'INNOVATE'] [Background: Clean]"],
|
46 |
+
["[Style: Modern] [Color: Black and Gold] [Concept: Luxury Brand] [Text: 'ELITE'] [Background: Gradient]"],
|
47 |
+
["[Style: Geometric] [Color: Green and Gray] [Concept: Eco Friendly] [Text: 'NATURE'] [Background: White]"],
|
48 |
+
["[ํ๊ธ] [์คํ์ผ: ๋ชจ๋] [์์: ๋นจ๊ฐ๊ณผ ๊ฒ์ ] [์ปจ์
: ์๋น] [ํ
์คํธ: '๋ง์๋์ง'] [๋ฐฐ๊ฒฝ: ์ฌํ]"],
|
49 |
+
["[Style: Corporate] [Color: Navy and Silver] [Concept: Finance] [Text: 'TRUST'] [Background: Professional]"],
|
50 |
+
["[Style: Dynamic] [Color: Purple and Orange] [Concept: Creative Agency] [Text: 'SPARK'] [Background: Abstract]"],
|
51 |
+
["[Style: Minimalist] [Color: Red and White] [Concept: Sports] [Text: 'POWER'] [Background: Clean]"]
|
52 |
]
|
53 |
|
54 |
css = """
|
55 |
+
footer {visibility: hidden}
|
56 |
+
.container {max-width: 850px; margin: auto; padding: 20px}
|
57 |
+
.title {text-align: center; margin-bottom: 20px}
|
58 |
+
#prompt {min-height: 50px}
|
59 |
+
#result {min-height: 400px}
|
60 |
+
.gr-box {border-radius: 10px; border: 1px solid #ddd}
|
61 |
"""
|
62 |
|
63 |
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as demo:
|
64 |
+
gr.HTML("<h1 class='title'>AI ๋ก๊ณ ์์ฑ๊ธฐ</h1>")
|
65 |
+
|
66 |
+
with gr.Column(elem_id="container"):
|
67 |
+
with gr.Group():
|
68 |
prompt = gr.Text(
|
69 |
+
label="๋ก๊ณ ์ค๋ช
",
|
70 |
+
placeholder="๋ก๊ณ ๋์์ธ์ ์์ธํ ์ค๋ช
ํด์ฃผ์ธ์ (ํ๊ธ ์
๋ ฅ ๊ฐ๋ฅ)",
|
71 |
+
lines=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
)
|
73 |
+
run_button = gr.Button("๋ก๊ณ ์์ฑ", variant="primary")
|
74 |
+
|
75 |
+
with gr.Row():
|
76 |
+
result = gr.Image(label="์์ฑ๋ ๋ก๊ณ ", show_label=True)
|
77 |
+
|
78 |
+
with gr.Accordion("๊ณ ๊ธ ์ค์ ", open=False):
|
79 |
with gr.Row():
|
80 |
+
seed = gr.Slider(label="์๋", minimum=0, maximum=MAX_SEED, step=1, value=0)
|
81 |
+
randomize_seed = gr.Checkbox(label="๋๋ค ์๋", value=True)
|
82 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
with gr.Row():
|
84 |
+
width = gr.Slider(label="๋๋น", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=512)
|
85 |
+
height = gr.Slider(label="๋์ด", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=512)
|
86 |
+
num_inference_steps = gr.Slider(label="ํ์ง", minimum=1, maximum=50, step=1, value=4)
|
|
|
|
|
|
|
|
|
87 |
|
88 |
gr.Examples(
|
89 |
examples=examples,
|