File size: 3,074 Bytes
6e6e228
34db193
6e6e228
 
34db193
6e6e228
 
34db193
6e6e228
 
 
 
 
 
 
 
 
 
34db193
 
 
6e6e228
 
 
 
 
34db193
6e6e228
34db193
 
6e6e228
 
 
34db193
 
 
6e6e228
 
 
 
 
 
 
 
34db193
 
6e6e228
 
 
 
34db193
 
6e6e228
 
 
 
 
 
34db193
6e6e228
 
 
 
34db193
 
6e6e228
 
 
34db193
 
6e6e228
 
 
 
 
 
34db193
6e6e228
34db193
 
6e6e228
 
 
 
 
34db193
 
6e6e228
 
 
 
 
 
 
 
34db193
6e6e228
 
 
 
 
 
 
 
 
 
 
 
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
106
107
108
109
import gradio as gr

# Load the model
model = gr.load("models/strangerzonehf/Flux-Midjourney-Mix2-LoRA")

# Define D&D-specific CSS with rich theming
custom_css = """
body {
    background-color: #1b1b1b; /* A dark, dungeon-like background */
    color: #f0e6d2; /* Off-white text to mimic aged parchment */
    font-family: 'Palatino Linotype', serif; /* Adds a fantasy-inspired font style */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.gradio-container {
    max-width: 900px;
    margin: auto;
    padding: 25px;
    background: linear-gradient(145deg, #2e2b2a, #3a3433); /* Subtle gradient for depth */
    border: 3px solid #a0522d; /* Bronze/gold-tone border resembling ancient artifacts */
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8); /* Shadowing for a mysterious effect */
}

h1, h2 {
    color: #ffd700; /* Gold to evoke a high-fantasy vibe */
    text-shadow: 2px 2px #7c5200; /* Slight shadow for richness */
    text-align: center;
}

textarea, input[type="text"] {
    background-color: #2a2927; /* Dark stone-like input background */
    color: #f5e6ca; /* Light text for easy readability */
    border: 2px solid #8b4513; /* Earthy brown border */
    border-radius: 5px;
    padding: 10px;
    font-family: 'Palatino Linotype', serif; /* Matches fantasy feel */
    font-size: 16px;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: #ffd700; /* Highlight effect when focused */
    box-shadow: 0 0 5px #ffd700;
}

button {
    background: #8b4513; /* Button styled in earthy tones */
    color: #f0e6d2;
    font-family: 'Palatino Linotype', serif;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    cursor: pointer;
    transition: 0.3s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

button:hover {
    background: #a0522d; /* Lighter tone for hover */
    box-shadow: 0 0 10px #ffd700;
}

.gradio-output {
    background-color: #292828; /* Keeps output aligned with the theme */
    color: #ffd700;
    border: 1px solid #8b4513;
    border-radius: 8px;
    margin-top: 20px;
    padding: 15px;
    text-align: center;
}

.gradio-output img {
    max-width: 100%;
    border: 2px solid #a0522d;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.footer {
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
    color: #ffd700;
    text-shadow: 1px 1px #7c5200;
}
"""

# Define Gradio interface
iface = gr.Interface(
    fn=model,  # Model function
    inputs=gr.Textbox(lines=3, label="Enter Your Quest Here:", placeholder="Describe the scene, character, or item..."),
    outputs=gr.Image(type="pil", label="Your Epic Creation"),
    title="🛡️ Dungeons & Dragons Image Generator ⚔️",
    description="Step into the Forgotten Realms and summon visuals straight out of your imagination. Powered by Flux-Midjourney-Mix2-LoRA!",
    css=custom_css
)

# Launch the interface
iface.launch()