Update app.py
Browse files
app.py
CHANGED
@@ -256,67 +256,95 @@ function stopAllAudio() {
|
|
256 |
currentlyPlaying = null;
|
257 |
}
|
258 |
"""
|
|
|
259 |
|
260 |
-
#
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
cfg_scale = gr.Slider(
|
267 |
-
label="CFG Scale",
|
268 |
-
minimum=1,
|
269 |
-
maximum=20,
|
270 |
-
step=0.5,
|
271 |
-
value=example_cfg_scale
|
272 |
-
)
|
273 |
-
steps = gr.Slider(
|
274 |
-
label="Steps",
|
275 |
-
minimum=1,
|
276 |
-
maximum=100,
|
277 |
-
step=1,
|
278 |
-
value=example_steps
|
279 |
-
)
|
280 |
-
lora_scale = gr.Slider(
|
281 |
-
label="LoRA Scale",
|
282 |
-
minimum=0,
|
283 |
-
maximum=1,
|
284 |
-
step=0.01,
|
285 |
-
value=example_lora_scale
|
286 |
-
)
|
287 |
-
|
288 |
-
with gr.Group(elem_classes="parameter-box"):
|
289 |
-
gr.Markdown("### ๐ Image Dimensions")
|
290 |
-
with gr.Row():
|
291 |
-
width = gr.Slider(
|
292 |
-
label="Width",
|
293 |
-
minimum=256,
|
294 |
-
maximum=1536,
|
295 |
-
step=64,
|
296 |
-
value=example_width
|
297 |
-
)
|
298 |
-
height = gr.Slider(
|
299 |
-
label="Height",
|
300 |
-
minimum=256,
|
301 |
-
maximum=1536,
|
302 |
-
step=64,
|
303 |
-
value=example_height
|
304 |
-
)
|
305 |
|
306 |
-
with gr.
|
307 |
-
gr.Markdown("
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
)
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
maximum=MAX_SEED,
|
317 |
-
step=1,
|
318 |
-
value=example_seed
|
319 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
|
321 |
# ์ค๋์ค ์ปจํธ๋กค
|
322 |
gr.HTML(f"""
|
|
|
256 |
currentlyPlaying = null;
|
257 |
}
|
258 |
"""
|
259 |
+
[์ด์ ์ฝ๋๋ ๋์ผ...]
|
260 |
|
261 |
+
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
262 |
+
app = gr.Blocks(css=custom_css)
|
263 |
+
|
264 |
+
with app:
|
265 |
+
# JavaScript ์ด๊ธฐํ
|
266 |
+
gr.HTML(f"<script>{snow_js}</script>")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
|
268 |
+
with gr.Column(elem_classes="container"):
|
269 |
+
gr.Markdown("# ๐ X-MAS LoRA", elem_classes="header")
|
270 |
+
|
271 |
+
# ์ด๋ฏธ์ง ์ถ๋ ฅ ์์ญ
|
272 |
+
with gr.Group(elem_classes="result-box box-common"):
|
273 |
+
gr.Markdown("### ๐ผ๏ธ Generated Image")
|
274 |
+
result = gr.Image(label="Result", elem_classes="image-output")
|
275 |
+
|
276 |
+
# ํ๋กฌํํธ ์
๋ ฅ ์์ญ
|
277 |
+
with gr.Group(elem_classes="prompt-box box-common"):
|
278 |
+
prompt = gr.TextArea(
|
279 |
+
label="โ๏ธ Your Prompt (ํ๊ธ ๋๋ ์์ด)",
|
280 |
+
placeholder="์ด๋ฏธ์ง๋ฅผ ์ค๋ช
ํ์ธ์...",
|
281 |
+
lines=5
|
282 |
)
|
283 |
+
generate_button = gr.Button(
|
284 |
+
"๐ Generate Image",
|
285 |
+
elem_classes="generate-btn"
|
|
|
|
|
|
|
286 |
)
|
287 |
+
|
288 |
+
# ๊ณ ๊ธ ์ต์
|
289 |
+
with gr.Accordion("๐จ Advanced Options", open=False, elem_classes="accordion box-common"):
|
290 |
+
with gr.Group(elem_classes="parameter-box"):
|
291 |
+
gr.Markdown("### ๐๏ธ Generation Parameters")
|
292 |
+
with gr.Row():
|
293 |
+
with gr.Column():
|
294 |
+
cfg_scale = gr.Slider(
|
295 |
+
label="CFG Scale",
|
296 |
+
minimum=1,
|
297 |
+
maximum=20,
|
298 |
+
step=0.5,
|
299 |
+
value=example_cfg_scale
|
300 |
+
)
|
301 |
+
steps = gr.Slider(
|
302 |
+
label="Steps",
|
303 |
+
minimum=1,
|
304 |
+
maximum=100,
|
305 |
+
step=1,
|
306 |
+
value=example_steps
|
307 |
+
)
|
308 |
+
lora_scale = gr.Slider(
|
309 |
+
label="LoRA Scale",
|
310 |
+
minimum=0,
|
311 |
+
maximum=1,
|
312 |
+
step=0.01,
|
313 |
+
value=example_lora_scale
|
314 |
+
)
|
315 |
+
|
316 |
+
with gr.Group(elem_classes="parameter-box"):
|
317 |
+
gr.Markdown("### ๐ Image Dimensions")
|
318 |
+
with gr.Row():
|
319 |
+
width = gr.Slider(
|
320 |
+
label="Width",
|
321 |
+
minimum=256,
|
322 |
+
maximum=1536,
|
323 |
+
step=64,
|
324 |
+
value=example_width
|
325 |
+
)
|
326 |
+
height = gr.Slider(
|
327 |
+
label="Height",
|
328 |
+
minimum=256,
|
329 |
+
maximum=1536,
|
330 |
+
step=64,
|
331 |
+
value=example_height
|
332 |
+
)
|
333 |
+
|
334 |
+
with gr.Group(elem_classes="parameter-box"):
|
335 |
+
gr.Markdown("### ๐ฒ Seed Settings")
|
336 |
+
with gr.Row():
|
337 |
+
randomize_seed = gr.Checkbox(
|
338 |
+
True,
|
339 |
+
label="Randomize seed"
|
340 |
+
)
|
341 |
+
seed = gr.Slider(
|
342 |
+
label="Seed",
|
343 |
+
minimum=0,
|
344 |
+
maximum=MAX_SEED,
|
345 |
+
step=1,
|
346 |
+
value=example_seed
|
347 |
+
)
|
348 |
|
349 |
# ์ค๋์ค ์ปจํธ๋กค
|
350 |
gr.HTML(f"""
|