Spaces:
Sleeping
Sleeping
ngoctuanai
commited on
Commit
•
1183d7a
1
Parent(s):
46206ee
Update app.py
Browse files
app.py
CHANGED
@@ -24,125 +24,131 @@ def query(prompt, is_negative=False, steps=1, cfg_scale=6, seed=None):
|
|
24 |
|
25 |
|
26 |
css = """
|
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 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
"""
|
147 |
|
148 |
with gr.Blocks(css=css, theme="pseudolab/huggingface-korea-theme") as dalle:
|
|
|
24 |
|
25 |
|
26 |
css = """
|
27 |
+
/* Improve overall layout and styling */
|
28 |
+
.gradio-container {
|
29 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
30 |
+
max-width: 800px; /* Adjusted max-width for better readability */
|
31 |
+
margin: auto;
|
32 |
+
padding: 1.5rem;
|
33 |
+
background-color: #f4f4f4; /* Added a light background color */
|
34 |
+
border-radius: 10px; /* Added border radius for a softer look */
|
35 |
+
}
|
36 |
+
|
37 |
+
/* Improve button styling */
|
38 |
+
.gr-button {
|
39 |
+
color: #fff;
|
40 |
+
background: #3498db; /* Changed button color to a shade of blue */
|
41 |
+
border: 1px solid #2980b9; /* Added a border for contrast */
|
42 |
+
border-radius: 5px; /* Added border radius for rounded corners */
|
43 |
+
padding: 10px 20px; /* Increased padding for a better click target */
|
44 |
+
}
|
45 |
+
|
46 |
+
.gr-button:hover {
|
47 |
+
background: #217dbb; /* Darker shade on hover for visual feedback */
|
48 |
+
}
|
49 |
+
|
50 |
+
/* Improve range input styling */
|
51 |
+
input[type='range'] {
|
52 |
+
accent-color: #3498db; /* Adjusted accent color for better visibility */
|
53 |
+
}
|
54 |
+
|
55 |
+
/* Improve gallery styling */
|
56 |
+
#gallery {
|
57 |
+
min-height: 300px;
|
58 |
+
margin: 15px auto; /* Centered the gallery with margin */
|
59 |
+
border-radius: 10px; /* Added border radius for a softer look */
|
60 |
+
overflow: hidden; /* Hide overflow for a cleaner appearance */
|
61 |
+
}
|
62 |
+
|
63 |
+
/* Add box shadow to gallery for depth */
|
64 |
+
#gallery>div {
|
65 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
66 |
+
}
|
67 |
+
|
68 |
+
/* Add transition to details for smoother underline effect */
|
69 |
+
.details {
|
70 |
+
transition: text-decoration 0.3s ease;
|
71 |
+
}
|
72 |
+
|
73 |
+
/* Add styling to advanced options button */
|
74 |
+
#advanced-btn {
|
75 |
+
font-size: 1rem;
|
76 |
+
line-height: 24px;
|
77 |
+
background-color: #27ae60; /* Green color for contrast */
|
78 |
+
color: #fff;
|
79 |
+
border-radius: 10px;
|
80 |
+
padding: 8px 16px;
|
81 |
+
cursor: pointer;
|
82 |
+
}
|
83 |
+
|
84 |
+
#advanced-btn:hover {
|
85 |
+
background-color: #219653; /* Darker green on hover */
|
86 |
+
}
|
87 |
+
|
88 |
+
/* Show advanced options by default */
|
89 |
+
#advanced-options {
|
90 |
+
display: block;
|
91 |
+
margin-bottom: 20px;
|
92 |
+
}
|
93 |
+
|
94 |
+
/* Improve footer styling */
|
95 |
+
.footer {
|
96 |
+
margin: 35px auto;
|
97 |
+
text-align: center;
|
98 |
+
border-top: 1px solid #e5e5e5;
|
99 |
+
padding: 15px 0;
|
100 |
+
}
|
101 |
+
|
102 |
+
.footer>p {
|
103 |
+
font-size: 1rem;
|
104 |
+
display: inline-block;
|
105 |
+
padding: 0 10px;
|
106 |
+
background: #fff;
|
107 |
+
border-radius: 5px;
|
108 |
+
margin: 0;
|
109 |
+
}
|
110 |
+
|
111 |
+
/* Improve acknowledgments heading */
|
112 |
+
.acknowledgments h4 {
|
113 |
+
margin: 1em 0 0.25em 0;
|
114 |
+
font-weight: bold;
|
115 |
+
font-size: 120%; /* Slightly increased font size */
|
116 |
+
}
|
117 |
+
|
118 |
+
/* Add a subtle spin animation to the loading spinner */
|
119 |
+
.animate-spin {
|
120 |
+
animation: spin 1s linear infinite;
|
121 |
+
}
|
122 |
+
|
123 |
+
/* Add box shadow to share button container for depth */
|
124 |
+
#share-btn-container {
|
125 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
126 |
+
overflow: hidden; /* Hide overflow for a cleaner appearance */
|
127 |
+
}
|
128 |
+
|
129 |
+
/* Adjust prompt container styles */
|
130 |
+
#prompt-container {
|
131 |
+
gap: 10px; /* Increased gap for better spacing */
|
132 |
+
}
|
133 |
+
|
134 |
+
/* Adjust prompt text input padding */
|
135 |
+
#prompt-text-input, #negative-prompt-text-input {
|
136 |
+
padding: 10px;
|
137 |
+
}
|
138 |
+
|
139 |
+
/* Adjust tab item styles */
|
140 |
+
.tabitem {
|
141 |
+
border: 1px solid #ddd; /* Added a subtle border */
|
142 |
+
border-radius: 5px; /* Added border radius for a softer look */
|
143 |
+
margin: 5px;
|
144 |
+
padding: 10px;
|
145 |
+
cursor: pointer;
|
146 |
+
}
|
147 |
+
|
148 |
+
.tabitem:hover {
|
149 |
+
background-color: #f5f5f5; /* Light background color on hover */
|
150 |
+
}
|
151 |
+
|
152 |
"""
|
153 |
|
154 |
with gr.Blocks(css=css, theme="pseudolab/huggingface-korea-theme") as dalle:
|