Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
f3d7ae3
1
Parent(s):
326c3fe
dnd
Browse files
app.py
CHANGED
|
@@ -2384,68 +2384,102 @@ css = '''
|
|
| 2384 |
#gen_btn{height: 100%}
|
| 2385 |
#gen_column{align-self: stretch}
|
| 2386 |
#title{text-align: center}
|
| 2387 |
-
#title h1{font-size: 3em; display:inline-flex; align-items:center}
|
| 2388 |
#title img{width: 100px; margin-right: 0.5em}
|
| 2389 |
#gallery .grid-wrap{height: 10vh}
|
| 2390 |
-
#lora_list{background: var(--block-background-fill);padding: 0 1em .3em; font-size: 90
|
| 2391 |
-
.card_internal{display: flex;height: 100px;margin-top: .5em}
|
| 2392 |
-
.card_internal img{margin-right: 1em}
|
| 2393 |
.styler{--form-gap-width: 0px !important}
|
| 2394 |
#progress{height:30px}
|
| 2395 |
#progress .generating{display:none}
|
| 2396 |
.progress-container {width: 100%;height: 30px;background-color: #f0f0f0;border-radius: 15px;overflow: hidden;margin-bottom: 20px}
|
| 2397 |
-
.progress-bar {height: 100%;background-color: #
|
|
|
|
| 2398 |
'''
|
| 2399 |
|
| 2400 |
with gr.Blocks(theme="YTheme/Minecraft", css=css, delete_cache=(60, 60)) as app:
|
| 2401 |
title = gr.HTML(
|
| 2402 |
-
"""<h1
|
| 2403 |
elem_id="title",
|
| 2404 |
)
|
| 2405 |
selected_index = gr.State(None)
|
| 2406 |
with gr.Row():
|
| 2407 |
with gr.Column(scale=3):
|
| 2408 |
-
prompt = gr.Textbox(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2409 |
with gr.Column(scale=1, elem_id="gen_column"):
|
| 2410 |
-
generate_button = gr.Button("
|
| 2411 |
with gr.Row():
|
| 2412 |
with gr.Column():
|
| 2413 |
selected_info = gr.Markdown("")
|
| 2414 |
gallery = gr.Gallery(
|
| 2415 |
[(item["image"], item["title"]) for item in loras],
|
| 2416 |
-
label="LoRA
|
| 2417 |
allow_preview=False,
|
| 2418 |
columns=3,
|
| 2419 |
elem_id="gallery",
|
| 2420 |
show_share_button=False
|
| 2421 |
)
|
| 2422 |
with gr.Group():
|
| 2423 |
-
custom_lora = gr.Textbox(
|
| 2424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2425 |
custom_lora_info = gr.HTML(visible=False)
|
| 2426 |
-
custom_lora_button = gr.Button("Remove
|
| 2427 |
with gr.Column():
|
| 2428 |
-
progress_bar = gr.Markdown(elem_id="progress",visible=False)
|
| 2429 |
-
result = gr.Image(label="
|
| 2430 |
|
| 2431 |
with gr.Row():
|
| 2432 |
-
with gr.Accordion("Advanced Settings", open=False):
|
| 2433 |
with gr.Row():
|
| 2434 |
-
input_image = gr.Image(label="Input
|
| 2435 |
-
image_strength = gr.Slider(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2436 |
with gr.Column():
|
| 2437 |
with gr.Row():
|
| 2438 |
-
cfg_scale = gr.Slider(
|
| 2439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2440 |
|
| 2441 |
with gr.Row():
|
| 2442 |
-
width = gr.Slider(
|
| 2443 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2444 |
|
| 2445 |
with gr.Row():
|
| 2446 |
-
randomize_seed = gr.Checkbox(True, label="Randomize
|
| 2447 |
-
seed = gr.Slider(
|
| 2448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2449 |
|
| 2450 |
gallery.select(
|
| 2451 |
update_selection,
|
|
@@ -2469,4 +2503,4 @@ with gr.Blocks(theme="YTheme/Minecraft", css=css, delete_cache=(60, 60)) as app:
|
|
| 2469 |
)
|
| 2470 |
|
| 2471 |
app.queue()
|
| 2472 |
-
app.launch()
|
|
|
|
| 2384 |
#gen_btn{height: 100%}
|
| 2385 |
#gen_column{align-self: stretch}
|
| 2386 |
#title{text-align: center}
|
| 2387 |
+
#title h1{font-size: 3em; display:inline-flex; align-items:center; color: #ffd700;}
|
| 2388 |
#title img{width: 100px; margin-right: 0.5em}
|
| 2389 |
#gallery .grid-wrap{height: 10vh}
|
| 2390 |
+
#lora_list{background: var(--block-background-fill);padding: 0 1em .3em; font-size: 90%; color: #ffd700;}
|
| 2391 |
+
.card_internal{display: flex;height: 100px;margin-top: .5em; border: 2px solid #8b4513; background: #3a3a3a;}
|
| 2392 |
+
.card_internal img{margin-right: 1em; border-radius: 5px;}
|
| 2393 |
.styler{--form-gap-width: 0px !important}
|
| 2394 |
#progress{height:30px}
|
| 2395 |
#progress .generating{display:none}
|
| 2396 |
.progress-container {width: 100%;height: 30px;background-color: #f0f0f0;border-radius: 15px;overflow: hidden;margin-bottom: 20px}
|
| 2397 |
+
.progress-bar {height: 100%;background-color: #d2691e;width: calc(var(--current) / var(--total) * 100%);transition: width 0.5s ease-in-out}
|
| 2398 |
+
body {background: url('https://www.transparenttextures.com/patterns/black-linen.png') center; font-family: 'Cinzel', serif; color: #ffd700;}
|
| 2399 |
'''
|
| 2400 |
|
| 2401 |
with gr.Blocks(theme="YTheme/Minecraft", css=css, delete_cache=(60, 60)) as app:
|
| 2402 |
title = gr.HTML(
|
| 2403 |
+
"""<h1>⚔️ ChatDnD.net: LoRA DLC for Legendary Quests ⚔️</h1>""",
|
| 2404 |
elem_id="title",
|
| 2405 |
)
|
| 2406 |
selected_index = gr.State(None)
|
| 2407 |
with gr.Row():
|
| 2408 |
with gr.Column(scale=3):
|
| 2409 |
+
prompt = gr.Textbox(
|
| 2410 |
+
label="🎲 Your Legendary Prompt",
|
| 2411 |
+
lines=1,
|
| 2412 |
+
placeholder="Describe your hero, villain, or epic battle scene..."
|
| 2413 |
+
)
|
| 2414 |
with gr.Column(scale=1, elem_id="gen_column"):
|
| 2415 |
+
generate_button = gr.Button("Forge Your Vision", variant="primary", elem_id="gen_btn")
|
| 2416 |
with gr.Row():
|
| 2417 |
with gr.Column():
|
| 2418 |
selected_info = gr.Markdown("")
|
| 2419 |
gallery = gr.Gallery(
|
| 2420 |
[(item["image"], item["title"]) for item in loras],
|
| 2421 |
+
label="🛡️ LoRA Artifacts 🛡️",
|
| 2422 |
allow_preview=False,
|
| 2423 |
columns=3,
|
| 2424 |
elem_id="gallery",
|
| 2425 |
show_share_button=False
|
| 2426 |
)
|
| 2427 |
with gr.Group():
|
| 2428 |
+
custom_lora = gr.Textbox(
|
| 2429 |
+
label="🔮 Add Custom Artifact (LoRA)",
|
| 2430 |
+
placeholder="prithivMLmods/Canopus-LoRA-Flux-Anime"
|
| 2431 |
+
)
|
| 2432 |
+
gr.Markdown(
|
| 2433 |
+
"""[Explore FLUX Artifacts Collection 📜](https://huggingface.co/models?other=base_model:adapter:black-forest-labs/FLUX.1-dev)""",
|
| 2434 |
+
elem_id="lora_list"
|
| 2435 |
+
)
|
| 2436 |
custom_lora_info = gr.HTML(visible=False)
|
| 2437 |
+
custom_lora_button = gr.Button("Remove Custom Artifact", visible=False)
|
| 2438 |
with gr.Column():
|
| 2439 |
+
progress_bar = gr.Markdown(elem_id="progress", visible=False)
|
| 2440 |
+
result = gr.Image(label="✨ Your D&D Masterpiece")
|
| 2441 |
|
| 2442 |
with gr.Row():
|
| 2443 |
+
with gr.Accordion("🛠️ Advanced Settings ⚙️", open=False):
|
| 2444 |
with gr.Row():
|
| 2445 |
+
input_image = gr.Image(label="📜 Use an Input Image", type="filepath")
|
| 2446 |
+
image_strength = gr.Slider(
|
| 2447 |
+
label="⚡ Denoise Strength",
|
| 2448 |
+
info="Lower values keep the input image’s influence stronger.",
|
| 2449 |
+
minimum=0.1, maximum=1.0, step=0.01, value=0.75
|
| 2450 |
+
)
|
| 2451 |
with gr.Column():
|
| 2452 |
with gr.Row():
|
| 2453 |
+
cfg_scale = gr.Slider(
|
| 2454 |
+
label="✨ Creativity Scale (CFG)",
|
| 2455 |
+
minimum=1, maximum=20, step=0.5, value=3.5
|
| 2456 |
+
)
|
| 2457 |
+
steps = gr.Slider(
|
| 2458 |
+
label="⏱️ Steps for Generation",
|
| 2459 |
+
minimum=1, maximum=50, step=1, value=28
|
| 2460 |
+
)
|
| 2461 |
|
| 2462 |
with gr.Row():
|
| 2463 |
+
width = gr.Slider(
|
| 2464 |
+
label="🖼️ Image Width",
|
| 2465 |
+
minimum=256, maximum=1536, step=64, value=1024
|
| 2466 |
+
)
|
| 2467 |
+
height = gr.Slider(
|
| 2468 |
+
label="🖼️ Image Height",
|
| 2469 |
+
minimum=256, maximum=1536, step=64, value=1024
|
| 2470 |
+
)
|
| 2471 |
|
| 2472 |
with gr.Row():
|
| 2473 |
+
randomize_seed = gr.Checkbox(True, label="🎲 Randomize Seed")
|
| 2474 |
+
seed = gr.Slider(
|
| 2475 |
+
label="🌟 Seed Value",
|
| 2476 |
+
minimum=0, maximum=MAX_SEED, step=1, value=0,
|
| 2477 |
+
randomize=True
|
| 2478 |
+
)
|
| 2479 |
+
lora_scale = gr.Slider(
|
| 2480 |
+
label="🔧 LoRA Intensity",
|
| 2481 |
+
minimum=0, maximum=3, step=0.01, value=0.95
|
| 2482 |
+
)
|
| 2483 |
|
| 2484 |
gallery.select(
|
| 2485 |
update_selection,
|
|
|
|
| 2503 |
)
|
| 2504 |
|
| 2505 |
app.queue()
|
| 2506 |
+
app.launch()
|