File size: 2,816 Bytes
a506a1a
 
4b35341
 
f558201
4b35341
 
 
 
 
 
 
 
fbec511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4b35341
 
 
 
 
 
 
 
 
 
 
f558201
 
dbf912a
 
4b35341
dbf912a
 
4b35341
 
 
dbf912a
 
 
 
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
110
111
112
113
import gradio as gr

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

# Define the custom HTML and CSS  
custom_html = """
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>D&D Themed Gradio Space</title>
    <style>
        body {
            background-color: #231f20;
            color: #f5f5f5;
            font-family: 'Arial', sans-serif;
        }

        .gradio-container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: #3c2f2f;
            border: 2px solid #8b4513;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        }

        h1, h2, h3, h4, h5, h6 {
            color: #ffd700;
            text-align: center;
        }

        button {
            background-color: #8b4513;
            color: #f5f5f5;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        button:hover {
            background-color: #a0522d;
        }

        input[type="text"], input[type="file"], textarea {
            background-color: #3c2f2f;
            color: #f5f5f5;
            border: 1px solid #8b4513;
            border-radius: 5px;
            padding: 10px;
            width: 100%;
            box-sizing: border-box;
            margin-bottom: 10px;
        }

        input[type="text"]:focus, input[type="file"]:focus, textarea:focus {
            border-color: #ffd700;
        }

        label {
            color: #ffd700;
        }

        .gradio-output {
            background-color: #3c2f2f;
            border: 1px solid #8b4513;
            border-radius: 5px;
            padding: 20px;
            margin-top: 20px;
            text-align: center;
        }

        .gradio-output img {
            max-width: 100%;
            border-radius: 10px;
        }

        .footer {
            text-align: center;
            margin-top: 20px;
            color: #ffd700;
        }
    </style>
</head>
<body>
    <div class="gradio-container">
        <h1>D&D Themed Gradio Space</h1>
        <div id="gradio-app"></div>
        <div class="footer">
            <p>Powered by Hugging Face and Gradio</p>
        </div>
    </div>
</body>
</html>
"""

# Define the Gradio interface  
iface = gr.Interface(
    fn=model,
    inputs=gr.Textbox(lines=2, placeholder="Enter your prompt here..."),
    outputs=gr.Image(type="pil"),
    title="D&D Themed Gradio Space",
    description="Generate images using the Flux-Midjourney-Mix2-LoRA model.",
    css=custom_html  
)

# Launch the Gradio interface  
iface.launch()