Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -224,6 +224,71 @@ if not torch.cuda.is_available():
|
|
| 224 |
MAX_SEED = np.iinfo(np.int32).max
|
| 225 |
MAX_IMAGE_SIZE = 4096
|
| 226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
if torch.cuda.is_available():
|
| 228 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
| 229 |
pipe = StableDiffusionXLPipeline.from_single_file(
|
|
@@ -290,12 +355,7 @@ examples = [
|
|
| 290 |
"klee (genshin impact)",
|
| 291 |
]
|
| 292 |
|
| 293 |
-
css =
|
| 294 |
-
.gradio-container{max-width: 560px !important}
|
| 295 |
-
h1{text-align:center}
|
| 296 |
-
'''
|
| 297 |
-
|
| 298 |
-
with gr.Blocks(css=css) as demo:
|
| 299 |
gr.Markdown("""# 梦羽的模型生成器
|
| 300 |
### 快速生成illustrious_pencil-XL模型的图片""")
|
| 301 |
with gr.Group():
|
|
|
|
| 224 |
MAX_SEED = np.iinfo(np.int32).max
|
| 225 |
MAX_IMAGE_SIZE = 4096
|
| 226 |
|
| 227 |
+
css = '''
|
| 228 |
+
.gradio-container {
|
| 229 |
+
max-width: 560px !important;
|
| 230 |
+
margin-left: auto !important;
|
| 231 |
+
margin-right: auto !important;
|
| 232 |
+
}
|
| 233 |
+
h1 {
|
| 234 |
+
text-align: center;
|
| 235 |
+
}
|
| 236 |
+
.info-text {
|
| 237 |
+
color: #474a50 !important;
|
| 238 |
+
}
|
| 239 |
+
.block {
|
| 240 |
+
border-width: 2px !important;
|
| 241 |
+
}
|
| 242 |
+
.form-row-container {
|
| 243 |
+
gap: 2px;
|
| 244 |
+
}
|
| 245 |
+
.tabs {
|
| 246 |
+
margin-left: 0 !important;
|
| 247 |
+
padding-left: 0 !important;
|
| 248 |
+
}
|
| 249 |
+
.tab-item {
|
| 250 |
+
padding-left: 0 !important;
|
| 251 |
+
margin-left: 0 !important;
|
| 252 |
+
}
|
| 253 |
+
.tab-nav {
|
| 254 |
+
margin-left: 0 !important;
|
| 255 |
+
padding-left: 0 !important;
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
/* 垂直标签样式 */
|
| 259 |
+
#settings {
|
| 260 |
+
display: flex !important;
|
| 261 |
+
}
|
| 262 |
+
#settings > div.tab-nav {
|
| 263 |
+
float: left !important;
|
| 264 |
+
display: flex !important;
|
| 265 |
+
flex-direction: column !important;
|
| 266 |
+
margin-left: 0 !important;
|
| 267 |
+
width: 10em !important;
|
| 268 |
+
}
|
| 269 |
+
#settings > div.tab-nav button {
|
| 270 |
+
display: block !important;
|
| 271 |
+
border: none !important;
|
| 272 |
+
text-align: left !important;
|
| 273 |
+
white-space: initial !important;
|
| 274 |
+
padding: 4px !important;
|
| 275 |
+
}
|
| 276 |
+
#settings > div.tab-content {
|
| 277 |
+
border: none !important;
|
| 278 |
+
margin-left: 10em !important;
|
| 279 |
+
padding: 0 var(--spacing-xl) !important;
|
| 280 |
+
flex: 1 !important;
|
| 281 |
+
}
|
| 282 |
+
#settings .settings-category {
|
| 283 |
+
display: block !important;
|
| 284 |
+
margin: 1em 0 0.25em 0 !important;
|
| 285 |
+
font-weight: bold !important;
|
| 286 |
+
text-decoration: underline !important;
|
| 287 |
+
cursor: default !important;
|
| 288 |
+
user-select: none !important;
|
| 289 |
+
}
|
| 290 |
+
'''
|
| 291 |
+
|
| 292 |
if torch.cuda.is_available():
|
| 293 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
| 294 |
pipe = StableDiffusionXLPipeline.from_single_file(
|
|
|
|
| 355 |
"klee (genshin impact)",
|
| 356 |
]
|
| 357 |
|
| 358 |
+
with gr.Blocks(css=css, fill_width=True) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
gr.Markdown("""# 梦羽的模型生成器
|
| 360 |
### 快速生成illustrious_pencil-XL模型的图片""")
|
| 361 |
with gr.Group():
|