fantaxy commited on
Commit
a2b21c2
ยท
verified ยท
1 Parent(s): f4e88b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -57
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
- ["Create a new logo for a [Color Tone: Blue] [Design Concept: ROCKET] [Text: 'WORLD'] [Background: BLUE COLOR]"],
44
- ["Create a new logo for a [Color Tone: Blue] [Design Concept: UNIVERSE] [Text: 'COCA COLA'] [Background: COLORFUL]"],
45
- ["simple futuristic logo kamikaze drone on a shield, minimalistic, vector, 2D, simple lines, White background --v 4"],
46
- ["Create a new logo for a [Color Tone: Blue] [Design Concept: MOUNTAIN] [Text: '[email protected]'] [Background: RED COLOR] "],
47
- ["Create a new logo for a [Color Tone: Blue] [Design Concept: HUMAN] [Text: 'ABC.COM'] [Background: YELLOW COLOR] "],
48
- ["Create a new logo for a [Color Tone: Blue] [Design Concept: HOUSE] [Text: 'T.010-1234-1234'] [Background: COLORFUL] "],
49
- ["Create a new logo for a [Color Tone: Blue] [Design Concept: LION] [Text: 'SOCCER CLUB'] [Background: GREEN COLOR]"]
50
  ]
51
 
52
  css = """
53
- footer {
54
- visibility: hidden;
55
- }
 
 
 
56
  """
57
 
58
  with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", 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("์‹คํ–‰", 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,
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
- num_inference_steps = gr.Slider(
104
- label="์ถ”๋ก  ๋‹จ๊ณ„ ์ˆ˜",
105
- minimum=1,
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,