Spaces:
Paused
Paused
Create constants.py
Browse files- constants.py +135 -0
constants.py
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
css = """
|
2 |
+
.gradio-container {
|
3 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
4 |
+
}
|
5 |
+
.gr-button {
|
6 |
+
color: white;
|
7 |
+
border-color: black;
|
8 |
+
background: black;
|
9 |
+
}
|
10 |
+
input[type='range'] {
|
11 |
+
accent-color: black;
|
12 |
+
}
|
13 |
+
.dark input[type='range'] {
|
14 |
+
accent-color: #dfdfdf;
|
15 |
+
}
|
16 |
+
.container {
|
17 |
+
max-width: 730px;
|
18 |
+
margin: auto;
|
19 |
+
padding-top: 1.5rem;
|
20 |
+
}
|
21 |
+
#gallery {
|
22 |
+
min-height: 22rem;
|
23 |
+
margin-bottom: 15px;
|
24 |
+
margin-left: auto;
|
25 |
+
margin-right: auto;
|
26 |
+
border-bottom-right-radius: .5rem !important;
|
27 |
+
border-bottom-left-radius: .5rem !important;
|
28 |
+
}
|
29 |
+
#gallery>div>.h-full {
|
30 |
+
min-height: 20rem;
|
31 |
+
}
|
32 |
+
.details:hover {
|
33 |
+
text-decoration: underline;
|
34 |
+
}
|
35 |
+
.gr-button {
|
36 |
+
white-space: nowrap;
|
37 |
+
}
|
38 |
+
.gr-button:focus {
|
39 |
+
border-color: rgb(147 197 253 / var(--tw-border-opacity));
|
40 |
+
outline: none;
|
41 |
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
42 |
+
--tw-border-opacity: 1;
|
43 |
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
44 |
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px var(--tw-ring-offset-width)) var(--tw-ring-color);
|
45 |
+
--tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity));
|
46 |
+
--tw-ring-opacity: .5;
|
47 |
+
}
|
48 |
+
#advanced-btn {
|
49 |
+
font-size: .7rem !important;
|
50 |
+
line-height: 19px;
|
51 |
+
margin-top: 12px;
|
52 |
+
margin-bottom: 12px;
|
53 |
+
padding: 2px 8px;
|
54 |
+
border-radius: 14px !important;
|
55 |
+
}
|
56 |
+
#advanced-options {
|
57 |
+
display: none;
|
58 |
+
margin-bottom: 20px;
|
59 |
+
}
|
60 |
+
.footer {
|
61 |
+
margin-bottom: 45px;
|
62 |
+
margin-top: 35px;
|
63 |
+
text-align: center;
|
64 |
+
border-bottom: 1px solid #e5e5e5;
|
65 |
+
}
|
66 |
+
.footer>p {
|
67 |
+
font-size: .8rem;
|
68 |
+
display: inline-block;
|
69 |
+
padding: 0 10px;
|
70 |
+
transform: translateY(10px);
|
71 |
+
background: white;
|
72 |
+
}
|
73 |
+
.dark .footer {
|
74 |
+
border-color: #303030;
|
75 |
+
}
|
76 |
+
.dark .footer>p {
|
77 |
+
background: #0b0f19;
|
78 |
+
}
|
79 |
+
.acknowledgments h4{
|
80 |
+
margin: 1.25em 0 .25em 0;
|
81 |
+
font-weight: bold;
|
82 |
+
font-size: 115%;
|
83 |
+
}
|
84 |
+
.animate-spin {
|
85 |
+
animation: spin 1s linear infinite;
|
86 |
+
}
|
87 |
+
@keyframes spin {
|
88 |
+
from {
|
89 |
+
transform: rotate(0deg);
|
90 |
+
}
|
91 |
+
to {
|
92 |
+
transform: rotate(360deg);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
#share-btn-container {
|
96 |
+
display: flex; padding-left: 0.5rem !important; padding-right: 0.5rem !important; background-color: #000000; justify-content: center; align-items: center; border-radius: 9999px !important; width: 13rem;
|
97 |
+
margin-top: 10px;
|
98 |
+
margin-left: auto;
|
99 |
+
}
|
100 |
+
#share-btn {
|
101 |
+
all: initial; color: #ffffff;font-weight: 600; cursor:pointer; font-family: 'IBM Plex Sans', sans-serif; margin-left: 0.5rem !important; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important;right:0;
|
102 |
+
}
|
103 |
+
#share-btn * {
|
104 |
+
all: unset;
|
105 |
+
}
|
106 |
+
#share-btn-container div:nth-child(-n+2){
|
107 |
+
width: auto !important;
|
108 |
+
min-height: 0px !important;
|
109 |
+
}
|
110 |
+
#share-btn-container .wrap {
|
111 |
+
display: none !important;
|
112 |
+
}
|
113 |
+
|
114 |
+
.gr-form{
|
115 |
+
flex: 1 1 50%; border-top-right-radius: 0; border-bottom-right-radius: 0;
|
116 |
+
}
|
117 |
+
#prompt-container{
|
118 |
+
gap: 0;
|
119 |
+
}
|
120 |
+
#prompt-text-input, #negative-prompt-text-input{padding: .45rem 0.625rem}
|
121 |
+
#component-16{border-top-width: 1px!important;margin-top: 1em}
|
122 |
+
.image_duplication{position: absolute; width: 100px; left: 50px}
|
123 |
+
"""
|
124 |
+
|
125 |
+
|
126 |
+
examples = [
|
127 |
+
["Yoda", "low quality", 40],
|
128 |
+
["A red pokemon with green eyes", 40],
|
129 |
+
["cute Sundar Pihcai creature", 40],
|
130 |
+
["Hello kitty", 40],
|
131 |
+
]
|
132 |
+
|
133 |
+
num_images_to_gen = 3
|
134 |
+
|
135 |
+
img_height = img_width = 512
|