WatchOutForMike commited on
Commit
354ca2f
·
1 Parent(s): f5ee5fe
Files changed (1) hide show
  1. app.py +91 -49
app.py CHANGED
@@ -1,55 +1,97 @@
1
- import gradio as gr
2
-
3
- # Define the CSS for the D&D theme
4
- dnd_css = """
5
- body {
6
- background-color: #1f1f1f;
7
- color: #e0e0e0;
8
- font-family: 'Cinzel', serif;
9
- }
10
- .gradio-container {
11
- background-color: #2c2c2c;
12
- border: 2px solid #8b5a2b;
13
- border-radius: 10px;
14
- padding: 20px;
15
- }
16
- .gradio-input, .gradio-output {
17
- background-color: #3a3a3a;
18
- color: #e0e0e0;
19
- border: 1px solid #8b5a2b;
20
- border-radius: 5px;
21
- padding: 10px;
22
- }
23
- .gradio-button {
24
- background-color: #8b5a2b;
25
- color: #e0e0e0;
26
- border: none;
27
- border-radius: 5px;
28
- padding: 10px 20px;
29
- font-family: 'Cinzel', serif;
30
- }
31
- .gradio-button:hover {
32
- background-color: #a8673f;
33
- }
34
- .gradio-title {
35
- color: #e0e0e0;
36
- font-family: 'Cinzel', serif;
37
- font-size: 24px;
38
- text-align: center;
39
- margin-bottom: 20px;
40
- }
41
- """
 
42
 
43
- # Load the model
44
- model = gr.load("models/prashanth970/flux-lora-uncensored")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
- # Launch the Gradio app with the D&D theme
47
  iface = gr.Interface(
48
- fn=model,
49
- inputs="text",
50
- outputs="text",
51
- title="Dungeons & Dragons Theme",
52
- css=dnd_css
 
 
 
 
53
  )
54
 
 
55
  iface.launch()
 
1
+ import gradio as gr
2
+ from PIL import Image
3
+ import time
4
+
5
+ # Dummy model function for demonstration purposes
6
+ def model(prompt):
7
+ # Simulate a model processing time
8
+ time.sleep(2)
9
+ # Return a placeholder image
10
+ return Image.new('RGB', (512, 512), color = (73, 109, 137))
11
+
12
+ # Define Gradio interface with a loading animation
13
+ def model_with_loading(prompt):
14
+ return model(prompt)
15
+
16
+ # Custom CSS for D&D theme
17
+ custom_css = """
18
+ body {
19
+ background-color: #231f20;
20
+ color: #f5f5f5;
21
+ font-family: 'Arial', sans-serif;
22
+ }
23
+
24
+ .gradio-container {
25
+ background-color: #3c2a21;
26
+ border-radius: 10px;
27
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
28
+ }
29
+
30
+ .gr-button {
31
+ background-color: #8b4513;
32
+ color: #f5f5f5;
33
+ border: none;
34
+ border-radius: 5px;
35
+ padding: 10px 20px;
36
+ font-size: 16px;
37
+ cursor: pointer;
38
+ }
39
+
40
+ .gr-button:hover {
41
+ background-color: #a0522d;
42
+ }
43
 
44
+ .gr-textbox {
45
+ background-color: #4a3728;
46
+ color: #f5f5f5;
47
+ border: 1px solid #8b4513;
48
+ border-radius: 5px;
49
+ padding: 10px;
50
+ font-size: 16px;
51
+ }
52
+
53
+ .gr-textbox::placeholder {
54
+ color: #d3d3d3;
55
+ }
56
+
57
+ .gr-image {
58
+ border: 2px solid #8b4513;
59
+ border-radius: 10px;
60
+ }
61
+
62
+ .gr-title {
63
+ color: #ffd700;
64
+ font-size: 24px;
65
+ font-weight: bold;
66
+ }
67
+
68
+ .gr-description {
69
+ color: #ffd700;
70
+ font-size: 18px;
71
+ }
72
+
73
+ .gr-link {
74
+ color: #ffd700;
75
+ text-decoration: underline;
76
+ }
77
+
78
+ .gr-link:hover {
79
+ color: #ffa500;
80
+ }
81
+ """
82
 
83
+ # Define Gradio interface
84
  iface = gr.Interface(
85
+ fn=model_with_loading,
86
+ inputs=gr.Textbox(lines=3, label="🎲 Enter Your Quest:", placeholder="Describe your scene, hero, or epic landscape..."),
87
+ outputs=gr.Image(type="pil", label="🖼️ Your Legendary Vision"),
88
+ title="🛡️ Dungeons & Dragons Image Generator ⚔️",
89
+ description="**Unleash Your Imagination!** Create heroes, maps, quests, and epic scenes to bring your campaigns to life. "
90
+ "Tailored for adventurers seeking inspiration or Dungeon Masters constructing their next grand story. <br>"
91
+ "[Visit Our Website](https://chatdnd.net) | [Support Us](https://buymeacoffee.com/watchoutformike)",
92
+ css=custom_css,
93
+ live=False
94
  )
95
 
96
+ # Launch the interface
97
  iface.launch()