WatchOutForMike commited on
Commit
ccafece
·
1 Parent(s): 905deeb
Files changed (1) hide show
  1. app.py +1 -170
app.py CHANGED
@@ -1,172 +1,3 @@
1
  import gradio as gr
2
 
3
- # Load the model
4
- model = gr.load("models/prashanth970/flux-lora-uncensored")
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
- body {
10
- background-color: #1b1b1b; /* Dungeon-like backdrop */
11
- color: #f5f5f5;
12
- font-family: 'Cinzel', serif; /* Fantasy-themed font */
13
- margin: 0;
14
- padding: 0;
15
- display: flex;
16
- flex-direction: column;
17
- align-items: center;
18
- justify-content: flex-start;
19
- height: 100vh;
20
- background-image: url('https://www.transparenttextures.com/patterns/dark-matter.png'); /* Subtle dungeon texture */
21
- }
22
- .gradio-container {
23
- max-width: 950px;
24
- margin: auto;
25
- padding: 30px;
26
- background: linear-gradient(145deg, #2e2b2a, #3a3433); /* Mystic gradient for depth */
27
- border: 4px solid #8b4513;
28
- border-radius: 15px;
29
- box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
30
- }
31
- h1, h2 {
32
- color: #ffd700;
33
- text-align: center;
34
- font-family: 'Uncial Antiqua', serif; /* Ancient fantasy font */
35
- text-shadow: 3px 3px #7c5200; /* Gold shine effect */
36
- }
37
- .description {
38
- margin-top: 15px;
39
- color: #d4af37; /* Lighter gold for elegance */
40
- font-size: 18px;
41
- line-height: 1.6;
42
- text-align: center;
43
- }
44
- a {
45
- color: #ffd700;
46
- text-decoration: none;
47
- font-weight: bold;
48
- }
49
- a:hover {
50
- color: #ffcc33; /* Brighter gold for interactivity */
51
- }
52
- textarea, input[type="text"] {
53
- background-color: #292828;
54
- color: #f5e6ca;
55
- border: 2px solid #8b4513;
56
- border-radius: 5px;
57
- padding: 10px;
58
- font-family: 'Palatino Linotype', serif;
59
- font-size: 16px;
60
- }
61
- textarea:focus, input[type="text"]:focus {
62
- outline: none;
63
- border-color: #ffd700;
64
- box-shadow: 0 0 8px #ffd700;
65
- }
66
- button {
67
- background: #8b4513;
68
- color: #f0e6d2;
69
- font-size: 18px;
70
- font-family: 'Palatino Linotype', serif;
71
- border: none;
72
- border-radius: 8px;
73
- padding: 12px 30px;
74
- cursor: pointer;
75
- transition: 0.3s ease-in-out;
76
- box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
77
- }
78
- button:hover {
79
- background: #a0522d;
80
- box-shadow: 0 0 15px #ffd700;
81
- }
82
- .gradio-output {
83
- background: #2f2f2f;
84
- color: #ffd700;
85
- border: 2px solid #8b4513;
86
- border-radius: 8px;
87
- padding: 20px;
88
- text-align: center;
89
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
90
- }
91
- .gradio-output img {
92
- max-width: 100%;
93
- border: 2px solid #a0522d;
94
- border-radius: 8px;
95
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
96
- }
97
- .footer {
98
- text-align: center;
99
- margin-top: 30px;
100
- color: #ffd700;
101
- font-size: 14px;
102
- text-shadow: 1px 1px #7c5200;
103
- }
104
- .footer a {
105
- color: #ffd700;
106
- text-decoration: none;
107
- margin: 0 10px;
108
- }
109
- .footer a:hover {
110
- color: #ffcc33;
111
- text-shadow: 2px 2px #ff9900;
112
- }
113
- @keyframes fadeIn {
114
- 0% { opacity: 0; }
115
- 100% { opacity: 1; }
116
- }
117
- .loading-animation {
118
- text-align: center;
119
- color: #ffd700;
120
- font-size: 18px;
121
- margin-top: 10px;
122
- font-family: 'Uncial Antiqua', serif;
123
- animation: fadeIn 1.5s ease-in-out infinite alternate;
124
- }
125
- """
126
-
127
- # JavaScript for optional background music
128
- background_music = """
129
- <script>
130
- var audio = new Audio('https://www.fesliyanstudios.com/play-mp3/387');
131
- audio.loop = true;
132
- audio.volume = 0.5;
133
- audio.play();
134
- </script>
135
- """
136
-
137
- # Define Gradio interface with a loading animation
138
- def model_with_loading(prompt):
139
- return model(prompt)
140
-
141
- # Custom HTML template with background music
142
- custom_html = f"""
143
- <!DOCTYPE html>
144
- <html lang="en">
145
- <head>
146
- <meta charset="UTF-8">
147
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
148
- <title>D&D Image Generator</title>
149
- <style>{custom_css}</style>
150
- </head>
151
- <body>
152
- <div id="gradio-app"></div>
153
- {background_music}
154
- </body>
155
- </html>
156
- """
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
- template=custom_html
169
- )
170
-
171
- # Launch the interface
172
- iface.launch(inline=False)
 
1
  import gradio as gr
2
 
3
+ gr.load("models/prashanth970/flux-lora-uncensored").launch()