Commit
·
ce3076c
1
Parent(s):
22deffa
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,6 +44,22 @@ css = """
|
|
| 44 |
.gradio-container {
|
| 45 |
font-family: 'IBM Plex Sans', sans-serif;
|
| 46 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
#gallery {
|
| 48 |
min-height: 22rem;
|
| 49 |
margin-bottom: 15px;
|
|
@@ -54,7 +70,98 @@ css = """
|
|
| 54 |
}
|
| 55 |
#gallery>div>.h-full {
|
| 56 |
min-height: 20rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
"""
|
| 59 |
|
| 60 |
with gr.Blocks(css=css) as demo:
|
|
@@ -77,15 +184,15 @@ with gr.Blocks(css=css) as demo:
|
|
| 77 |
"""
|
| 78 |
)
|
| 79 |
with gr.Group():
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
|
| 90 |
|
| 91 |
|
|
|
|
| 44 |
.gradio-container {
|
| 45 |
font-family: 'IBM Plex Sans', sans-serif;
|
| 46 |
}
|
| 47 |
+
.gr-button {
|
| 48 |
+
color: white;
|
| 49 |
+
border-color: black;
|
| 50 |
+
background: black;
|
| 51 |
+
}
|
| 52 |
+
input[type='range'] {
|
| 53 |
+
accent-color: black;
|
| 54 |
+
}
|
| 55 |
+
.dark input[type='range'] {
|
| 56 |
+
accent-color: #dfdfdf;
|
| 57 |
+
}
|
| 58 |
+
.container {
|
| 59 |
+
max-width: 730px;
|
| 60 |
+
margin: auto;
|
| 61 |
+
padding-top: 1.5rem;
|
| 62 |
+
}
|
| 63 |
#gallery {
|
| 64 |
min-height: 22rem;
|
| 65 |
margin-bottom: 15px;
|
|
|
|
| 70 |
}
|
| 71 |
#gallery>div>.h-full {
|
| 72 |
min-height: 20rem;
|
| 73 |
+
|
| 74 |
+
}
|
| 75 |
+
.details:hover {
|
| 76 |
+
text-decoration: underline;
|
| 77 |
+
}
|
| 78 |
+
.gr-button {
|
| 79 |
+
white-space: nowrap;
|
| 80 |
+
}
|
| 81 |
+
.gr-button:focus {
|
| 82 |
+
border-color: rgb(147 197 253 / var(--tw-border-opacity));
|
| 83 |
+
outline: none;
|
| 84 |
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
| 85 |
+
--tw-border-opacity: 1;
|
| 86 |
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
| 87 |
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px var(--tw-ring-offset-width)) var(--tw-ring-color);
|
| 88 |
+
--tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity));
|
| 89 |
+
--tw-ring-opacity: .5;
|
| 90 |
+
}
|
| 91 |
+
#advanced-btn {
|
| 92 |
+
font-size: .7rem !important;
|
| 93 |
+
line-height: 19px;
|
| 94 |
+
margin-top: 12px;
|
| 95 |
+
margin-bottom: 12px;
|
| 96 |
+
padding: 2px 8px;
|
| 97 |
+
border-radius: 14px !important;
|
| 98 |
+
}
|
| 99 |
+
#advanced-options {
|
| 100 |
+
display: none;
|
| 101 |
+
margin-bottom: 20px;
|
| 102 |
+
}
|
| 103 |
+
.footer {
|
| 104 |
+
margin-bottom: 45px;
|
| 105 |
+
margin-top: 35px;
|
| 106 |
+
text-align: center;
|
| 107 |
+
border-bottom: 1px solid #e5e5e5;
|
| 108 |
+
}
|
| 109 |
+
.footer>p {
|
| 110 |
+
font-size: .8rem;
|
| 111 |
+
display: inline-block;
|
| 112 |
+
padding: 0 10px;
|
| 113 |
+
transform: translateY(10px);
|
| 114 |
+
background: white;
|
| 115 |
+
}
|
| 116 |
+
.dark .footer {
|
| 117 |
+
border-color: #303030;
|
| 118 |
+
}
|
| 119 |
+
.dark .footer>p {
|
| 120 |
+
background: #0b0f19;
|
| 121 |
}
|
| 122 |
+
.acknowledgments h4{
|
| 123 |
+
margin: 1.25em 0 .25em 0;
|
| 124 |
+
font-weight: bold;
|
| 125 |
+
font-size: 115%;
|
| 126 |
+
}
|
| 127 |
+
.animate-spin {
|
| 128 |
+
animation: spin 1s linear infinite;
|
| 129 |
+
}
|
| 130 |
+
@keyframes spin {
|
| 131 |
+
from {
|
| 132 |
+
transform: rotate(0deg);
|
| 133 |
+
}
|
| 134 |
+
to {
|
| 135 |
+
transform: rotate(360deg);
|
| 136 |
+
}
|
| 137 |
+
}
|
| 138 |
+
#share-btn-container {
|
| 139 |
+
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;
|
| 140 |
+
margin-top: 10px;
|
| 141 |
+
margin-left: auto;
|
| 142 |
+
}
|
| 143 |
+
#share-btn {
|
| 144 |
+
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;
|
| 145 |
+
}
|
| 146 |
+
#share-btn * {
|
| 147 |
+
all: unset;
|
| 148 |
+
}
|
| 149 |
+
#share-btn-container div:nth-child(-n+2){
|
| 150 |
+
width: auto !important;
|
| 151 |
+
min-height: 0px !important;
|
| 152 |
+
}
|
| 153 |
+
#share-btn-container .wrap {
|
| 154 |
+
display: none !important;
|
| 155 |
+
}
|
| 156 |
+
.gr-form{
|
| 157 |
+
flex: 1 1 50%; border-top-right-radius: 0; border-bottom-right-radius: 0;
|
| 158 |
+
}
|
| 159 |
+
#prompt-container{
|
| 160 |
+
gap: 0;
|
| 161 |
+
}
|
| 162 |
+
#prompt-text-input, #negative-prompt-text-input{padding: .45rem 0.625rem}
|
| 163 |
+
#component-16{border-top-width: 1px!important;margin-top: 1em}
|
| 164 |
+
.image_duplication{position: absolute; width: 100px; left: 50px}
|
| 165 |
"""
|
| 166 |
|
| 167 |
with gr.Blocks(css=css) as demo:
|
|
|
|
| 184 |
"""
|
| 185 |
)
|
| 186 |
with gr.Group():
|
| 187 |
+
|
| 188 |
+
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
| 189 |
+
with gr.Column():
|
| 190 |
+
gallery_output = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
|
| 191 |
+
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
| 192 |
+
with gr.Column():
|
| 193 |
+
text_prompt = gr.Textbox(show_label=False, placeholder="Enter your prompt", max_lines=1, elem_id="prompt-text-input").style(border=(True, False, True, True), rounded=(True, False, False, True), container=False)
|
| 194 |
+
negative_prompt = gr.Textbox(show_label=False, placeholder="Enter a negative", max_lines=1, elem_id="negative-prompt-text-input").style(border=(True, False, True, True), rounded=(True, False, False, True), container=False)
|
| 195 |
+
text_button = gr.Button("Generate").style(margin=False, rounded=(False, True, True, False), full_width=False)
|
| 196 |
|
| 197 |
|
| 198 |
|