fantaxy commited on
Commit
4ff5580
β€’
1 Parent(s): d715c4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -20
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("Translating Korean prompt...")
28
  translated_prompt = translator(prompt, max_length=512)[0]['translation_text']
29
- print("Translated prompt:", translated_prompt)
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
- ["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: 'abc@gmail.com'] [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 = """
@@ -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="Prompt",
63
  show_label=False,
64
  max_lines=1,
65
- placeholder="Enter your prompt",
66
  container=False,
67
  elem_id="prompt"
68
  )
69
 
70
- run_button = gr.Button("Run", scale=0)
71
 
72
- result = gr.Image(label="Result", show_label=False, elem_id="result")
73
 
74
- with gr.Accordion("Advanced Settings", open=False, elem_id="advanced-settings"):
75
  seed = gr.Slider(
76
- label="Seed",
77
  minimum=0,
78
  maximum=MAX_SEED,
79
  step=1,
80
  value=0,
81
  )
82
 
83
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
84
 
85
  with gr.Row():
86
  width = gr.Slider(
87
- label="Width",
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="Height",
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="Number of inference steps",
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()