Spaces:
Running
Running
chore : update ui
Browse files
__pycache__/live_preview_helpers.cpython-310.pyc
CHANGED
Binary files a/__pycache__/live_preview_helpers.cpython-310.pyc and b/__pycache__/live_preview_helpers.cpython-310.pyc differ
|
|
__pycache__/llm_wrapper.cpython-310.pyc
CHANGED
Binary files a/__pycache__/llm_wrapper.cpython-310.pyc and b/__pycache__/llm_wrapper.cpython-310.pyc differ
|
|
app.py
CHANGED
@@ -69,86 +69,98 @@ examples = [
|
|
69 |
css="""
|
70 |
#col-container {
|
71 |
margin: 0 auto;
|
72 |
-
max-width:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
"""
|
75 |
|
76 |
-
with gr.Blocks(css=css) as demo:
|
77 |
|
78 |
with gr.Column(elem_id="col-container"):
|
79 |
-
gr.Markdown(f"""# [POSTECH] PONIX Generator
|
80 |
[[based on FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md)]
|
81 |
""")
|
82 |
|
83 |
-
with gr.
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
prompt = gr.Text(
|
86 |
-
label="
|
87 |
-
show_label=False,
|
88 |
max_lines=1,
|
89 |
-
placeholder="
|
90 |
-
container=
|
91 |
)
|
92 |
|
93 |
-
run_button = gr.Button("
|
94 |
|
95 |
-
result = gr.Image(label="
|
96 |
|
97 |
-
with gr.Accordion("
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
)
|
104 |
-
|
105 |
-
|
106 |
-
seed = gr.Slider(
|
107 |
-
label="Seed",
|
108 |
-
minimum=0,
|
109 |
-
maximum=MAX_SEED,
|
110 |
-
step=1,
|
111 |
-
value=0,
|
112 |
-
)
|
113 |
-
|
114 |
-
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
115 |
-
|
116 |
-
with gr.Row():
|
117 |
-
|
118 |
-
width = gr.Slider(
|
119 |
-
label="Width",
|
120 |
-
minimum=256,
|
121 |
-
maximum=MAX_IMAGE_SIZE,
|
122 |
-
step=32,
|
123 |
-
value=1024,
|
124 |
)
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
|
|
152 |
gr.Examples(
|
153 |
examples = examples,
|
154 |
fn = infer,
|
@@ -156,6 +168,12 @@ with gr.Blocks(css=css) as demo:
|
|
156 |
outputs = [result, seed],
|
157 |
cache_examples="lazy"
|
158 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
gr.on(
|
161 |
triggers=[run_button.click, prompt.submit],
|
|
|
69 |
css="""
|
70 |
#col-container {
|
71 |
margin: 0 auto;
|
72 |
+
max-width: 580px;
|
73 |
+
}
|
74 |
+
|
75 |
+
.footer {
|
76 |
+
text-align: center;
|
77 |
+
margin-top: 20px;
|
78 |
+
font-size: 0.8em;
|
79 |
+
color: #666;
|
80 |
}
|
81 |
"""
|
82 |
|
83 |
+
with gr.Blocks(css=css, theme="soft") as demo:
|
84 |
|
85 |
with gr.Column(elem_id="col-container"):
|
86 |
+
gr.Markdown(f"""# π [POSTECH] PONIX Generator
|
87 |
[[based on FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md)]
|
88 |
""")
|
89 |
|
90 |
+
with gr.Box():
|
91 |
+
gr.Markdown("""
|
92 |
+
### π μ¬μ© κ°μ΄λ
|
93 |
+
- μμ±νκ³ μΆμ μ΄λ―Έμ§λ₯Ό νκΈλ‘ κ°λ¨νκ² μμ±ν΄μ£ΌμΈμ.
|
94 |
+
- μ΄λ―Έμ§λ λ
Έμ΄μ¦μμ μ μ°¨μ μΌλ‘ μμ±λ©λλ€. (40~50μ΄ μμ)
|
95 |
+
- λ¬Έμλ μ΄λ©μΌλ‘ λΆνλ립λλ€: [email protected]
|
96 |
+
""")
|
97 |
+
|
98 |
+
with gr.Group():
|
99 |
prompt = gr.Text(
|
100 |
+
label="ν둬ννΈ μ
λ ₯",
|
|
|
101 |
max_lines=1,
|
102 |
+
placeholder="μνλ ν¬λμ€ μ΄λ―Έμ§λ₯Ό νκΈλ‘ μ€λͺ
ν΄μ£ΌμΈμ",
|
103 |
+
container=True,
|
104 |
)
|
105 |
|
106 |
+
run_button = gr.Button("π μμ±νκΈ°", variant="primary")
|
107 |
|
108 |
+
result = gr.Image(label="μμ±λ μ΄λ―Έμ§")
|
109 |
|
110 |
+
with gr.Accordion("π οΈ κ³ κΈ μ€μ ", open=False):
|
111 |
+
with gr.Group():
|
112 |
+
use_prompt_refinement = gr.Checkbox(
|
113 |
+
label="ν둬ννΈ μλ κ°μ ",
|
114 |
+
value=True,
|
115 |
+
info="AIκ° μ
λ ₯ν ν둬ννΈλ₯Ό μλμΌλ‘ κ°μ ν©λλ€."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
)
|
117 |
|
118 |
+
with gr.Row():
|
119 |
+
seed = gr.Slider(
|
120 |
+
label="μλ κ°",
|
121 |
+
minimum=0,
|
122 |
+
maximum=MAX_SEED,
|
123 |
+
step=1,
|
124 |
+
value=0,
|
125 |
+
)
|
126 |
+
|
127 |
+
randomize_seed = gr.Checkbox(label="λλ€ μλ μ¬μ©", value=True)
|
128 |
+
|
129 |
+
with gr.Row():
|
130 |
+
width = gr.Slider(
|
131 |
+
label="λλΉ",
|
132 |
+
minimum=256,
|
133 |
+
maximum=MAX_IMAGE_SIZE,
|
134 |
+
step=32,
|
135 |
+
value=1024,
|
136 |
+
)
|
137 |
+
|
138 |
+
height = gr.Slider(
|
139 |
+
label="λμ΄",
|
140 |
+
minimum=256,
|
141 |
+
maximum=MAX_IMAGE_SIZE,
|
142 |
+
step=32,
|
143 |
+
value=1024,
|
144 |
+
)
|
145 |
+
|
146 |
+
with gr.Row():
|
147 |
+
guidance_scale = gr.Slider(
|
148 |
+
label="κ°μ΄λμ€ μ€μΌμΌ",
|
149 |
+
minimum=1,
|
150 |
+
maximum=15,
|
151 |
+
step=0.1,
|
152 |
+
value=3.5,
|
153 |
+
)
|
154 |
+
|
155 |
+
num_inference_steps = gr.Slider(
|
156 |
+
label="μΆλ‘ λ¨κ³ μ",
|
157 |
+
minimum=1,
|
158 |
+
maximum=50,
|
159 |
+
step=1,
|
160 |
+
value=28,
|
161 |
+
)
|
162 |
|
163 |
+
gr.Markdown("### μμ ν둬ννΈ")
|
164 |
gr.Examples(
|
165 |
examples = examples,
|
166 |
fn = infer,
|
|
|
168 |
outputs = [result, seed],
|
169 |
cache_examples="lazy"
|
170 |
)
|
171 |
+
|
172 |
+
gr.HTML("""
|
173 |
+
<div class="footer">
|
174 |
+
PONIX Generator by νμ±μ | POSTECH
|
175 |
+
</div>
|
176 |
+
""")
|
177 |
|
178 |
gr.on(
|
179 |
triggers=[run_button.click, prompt.submit],
|