WatchOutForMike commited on
Commit
fc97219
·
1 Parent(s): 5e17ab7
Files changed (1) hide show
  1. app.py +40 -9
app.py CHANGED
@@ -3,12 +3,14 @@ import gradio as gr
3
  # Load the model
4
  model = gr.load("models/strangerzonehf/Flux-Midjourney-Mix2-LoRA")
5
 
6
- # Enhanced D&D-themed CSS with previously used styles and new additions
7
  custom_css = """
 
 
8
  body {
9
  background-color: #1b1b1b; /* Dungeon-like backdrop */
10
  color: #f5f5f5;
11
- font-family: 'Palatino Linotype', serif; /* Fantasy-themed font */
12
  margin: 0;
13
  padding: 0;
14
  display: flex;
@@ -16,6 +18,7 @@ body {
16
  align-items: center;
17
  justify-content: flex-start;
18
  height: 100vh;
 
19
  }
20
 
21
  .gradio-container {
@@ -31,7 +34,8 @@ body {
31
  h1, h2 {
32
  color: #ffd700;
33
  text-align: center;
34
- text-shadow: 2px 2px #7c5200; /* Gold shine effect */
 
35
  }
36
 
37
  .description {
@@ -121,20 +125,47 @@ button:hover {
121
  color: #ffcc33;
122
  text-shadow: 2px 2px #ff9900;
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  """
125
 
126
- # Define Gradio interface with enhanced description and external links
 
 
 
127
  iface = gr.Interface(
128
- fn=model,
129
  inputs=gr.Textbox(lines=3, label="🎲 Enter Your Quest:", placeholder="Describe your scene, hero, or epic landscape..."),
130
  outputs=gr.Image(type="pil", label="🖼️ Your Legendary Vision"),
131
  title="🛡️ Dungeons & Dragons Image Generator ⚔️",
132
  description="**Unleash Your Imagination!** Create heroes, maps, quests, and epic scenes to bring your campaigns to life. "
133
  "Tailored for adventurers seeking inspiration or Dungeon Masters constructing their next grand story. <br>"
134
  "[Visit Our Website](https://chatdnd.net) | [Support Us](https://buymeacoffee.com/watchoutformike)",
135
- css=custom_css
 
136
  )
137
 
138
- # Launch the Gradio interface
139
- iface.launch()
140
-
 
3
  # Load the model
4
  model = gr.load("models/strangerzonehf/Flux-Midjourney-Mix2-LoRA")
5
 
6
+ # Updated CSS with new additions
7
  custom_css = """
8
+ @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Uncial+Antiqua&display=swap');
9
+
10
  body {
11
  background-color: #1b1b1b; /* Dungeon-like backdrop */
12
  color: #f5f5f5;
13
+ font-family: 'Cinzel', serif; /* Fantasy-themed font */
14
  margin: 0;
15
  padding: 0;
16
  display: flex;
 
18
  align-items: center;
19
  justify-content: flex-start;
20
  height: 100vh;
21
+ background-image: url('https://www.transparenttextures.com/patterns/dark-matter.png'); /* Subtle dungeon texture */
22
  }
23
 
24
  .gradio-container {
 
34
  h1, h2 {
35
  color: #ffd700;
36
  text-align: center;
37
+ font-family: 'Uncial Antiqua', serif; /* Ancient fantasy font */
38
+ text-shadow: 3px 3px #7c5200; /* Gold shine effect */
39
  }
40
 
41
  .description {
 
125
  color: #ffcc33;
126
  text-shadow: 2px 2px #ff9900;
127
  }
128
+
129
+ @keyframes fadeIn {
130
+ 0% { opacity: 0; }
131
+ 100% { opacity: 1; }
132
+ }
133
+
134
+ .loading-animation {
135
+ text-align: center;
136
+ color: #ffd700;
137
+ font-size: 18px;
138
+ margin-top: 10px;
139
+ font-family: 'Uncial Antiqua', serif;
140
+ animation: fadeIn 1.5s ease-in-out infinite alternate;
141
+ }
142
+ """
143
+
144
+ # JavaScript for optional background music
145
+ background_music = """
146
+ <script>
147
+ var audio = new Audio('https://www.fesliyanstudios.com/play-mp3/387');
148
+ audio.loop = true;
149
+ audio.volume = 0.5;
150
+ audio.play();
151
+ </script>
152
  """
153
 
154
+ # Define Gradio interface with a loading animation
155
+ def model_with_loading(prompt):
156
+ return model(prompt)
157
+
158
  iface = gr.Interface(
159
+ fn=model_with_loading,
160
  inputs=gr.Textbox(lines=3, label="🎲 Enter Your Quest:", placeholder="Describe your scene, hero, or epic landscape..."),
161
  outputs=gr.Image(type="pil", label="🖼️ Your Legendary Vision"),
162
  title="🛡️ Dungeons & Dragons Image Generator ⚔️",
163
  description="**Unleash Your Imagination!** Create heroes, maps, quests, and epic scenes to bring your campaigns to life. "
164
  "Tailored for adventurers seeking inspiration or Dungeon Masters constructing their next grand story. <br>"
165
  "[Visit Our Website](https://chatdnd.net) | [Support Us](https://buymeacoffee.com/watchoutformike)",
166
+ css=custom_css,
167
+ live=False
168
  )
169
 
170
+ # Launch the interface with background music
171
+ iface.launch(inline=False)