File size: 2,423 Bytes
6d93f4e 354ca2f 6d93f4e 90c4804 6d93f4e 90c4804 6d93f4e 90c4804 6d93f4e 354ca2f fde96e8 90c4804 6d93f4e 90c4804 bd30617 354ca2f 90c4804 6d93f4e 90c4804 6d93f4e 90c4804 354ca2f f5ee5fe 90c4804 fde96e8 90c4804 fde96e8 90c4804 6d93f4e bd30617 90c4804 354ca2f 90c4804 bd30617 90c4804 bd30617 90c4804 bd30617 90c4804 354ca2f 90c4804 bd30617 90c4804 fde96e8 354ca2f 90c4804 354ca2f 6d93f4e 90c4804 354ca2f 90c4804 354ca2f fde96e8 354ca2f 90c4804 354ca2f f5ee5fe 6d93f4e f5ee5fe 90c4804 6d93f4e 354ca2f 6d93f4e f5ee5fe 6d93f4e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
import gradio as gr
from PIL import Image
import time
# Load the model from Hugging Face
model = gr.load("models/prashanth970/flux-lora-uncensored")
# Define Gradio interface with a loading animation
def model_with_loading(prompt):
return model(prompt)
# Custom CSS for D&D theme
custom_css = """
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap');
body {
background-color: #1a1a1a;
color: #f5f5f5;
font-family: 'MedievalSharp', cursive;
}
.gradio-container {
background-color: #2c2c2c;
border-radius: 15px;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
padding: 20px;
}
.gr-button {
background-color: #8b4513;
color: #f5f5f5;
border: none;
border-radius: 8px;
padding: 12px 24px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s;
}
.gr-button:hover {
background-color: #a0522d;
}
.gr-textbox {
background-color: #3c3c3c;
color: #f5f5f5;
border: 2px solid #8b4513;
border-radius: 8px;
padding: 12px;
font-size: 18px;
width: 100%;
box-sizing: border-box;
}
.gr-textbox::placeholder {
color: #d3d3d3;
}
.gr-image {
border: 4px solid #8b4513;
border-radius: 15px;
margin-top: 20px;
}
.gr-title {
color: #ffd700;
font-size: 32px;
font-weight: bold;
text-align: center;
margin-bottom: 20px;
}
.gr-description {
color: #ffd700;
font-size: 20px;
text-align: center;
margin-bottom: 20px;
}
.gr-link {
color: #ffd700;
text-decoration: underline;
font-size: 18px;
}
.gr-link:hover {
color: #ffa500;
}
"""
# Define Gradio interface
iface = gr.Interface(
fn=model_with_loading,
inputs=gr.Textbox(lines=3, label="🎲 Enter Your Quest:", placeholder="Describe your scene, hero, or epic landscape..."),
outputs=gr.Image(type="pil", label="🖼️ Your Legendary Vision"),
title="🛡️ Dungeons & Dragons Image Generator ⚔️",
description="**Unleash Your Imagination!** Create heroes, maps, quests, and epic scenes to bring your campaigns to life. "
"Tailored for adventurers seeking inspiration or Dungeon Masters constructing their next grand story. <br>"
"[Visit Our Website](https://chatdnd.net) | [Support Us](https://buymeacoffee.com/watchoutformike)",
css=custom_css,
live=False
)
# Launch the interface
iface.launch() |