Spaces:
Runtime error
Runtime error
Update app_ctrlx.py
Browse files- app_ctrlx.py +34 -36
app_ctrlx.py
CHANGED
|
@@ -160,14 +160,25 @@ description = """<div>
|
|
| 160 |
|
| 161 |
@spaces.GPU
|
| 162 |
def inference(
|
| 163 |
-
structure_image,
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
progress=gr.Progress(track_tqdm=True)
|
| 172 |
):
|
| 173 |
torch.manual_seed(seed)
|
|
@@ -308,111 +319,98 @@ with gr.Blocks(theme=gr.themes.Default(), css=css, title="Ctrl-X (SDXL v1.0)") a
|
|
| 308 |
[
|
| 309 |
"assets/images/horse__point_cloud.jpg",
|
| 310 |
"assets/images/horse.jpg",
|
|
|
|
| 311 |
"a 3D point cloud of a horse",
|
| 312 |
"",
|
| 313 |
-
"a photo of a horse standing on grass",
|
| 314 |
-
0.6, 0.6,
|
| 315 |
],
|
| 316 |
[
|
| 317 |
"assets/images/cat__mesh.jpg",
|
| 318 |
"assets/images/tiger.jpg",
|
|
|
|
| 319 |
"a 3D mesh of a cat",
|
| 320 |
"",
|
| 321 |
-
"a photo of a tiger standing on snow",
|
| 322 |
-
0.6, 0.6,
|
| 323 |
],
|
| 324 |
[
|
| 325 |
"assets/images/dog__sketch.jpg",
|
| 326 |
"assets/images/squirrel.jpg",
|
|
|
|
| 327 |
"a sketch of a dog",
|
| 328 |
"",
|
| 329 |
-
"a photo of a squirrel",
|
| 330 |
-
0.6, 0.6,
|
| 331 |
],
|
| 332 |
[
|
| 333 |
"assets/images/living_room__seg.jpg",
|
| 334 |
"assets/images/van_gogh.jpg",
|
|
|
|
| 335 |
"a segmentation map of a living room",
|
| 336 |
"",
|
| 337 |
-
"a Van Gogh painting of a living room",
|
| 338 |
-
0.6, 0.6,
|
| 339 |
],
|
| 340 |
[
|
| 341 |
"assets/images/bedroom__sketch.jpg",
|
| 342 |
"assets/images/living_room_modern.jpg",
|
| 343 |
"a sketch of a bedroom",
|
| 344 |
-
"",
|
| 345 |
"a photo of a modern bedroom during sunset",
|
| 346 |
-
|
| 347 |
],
|
| 348 |
[
|
| 349 |
"assets/images/running__pose.jpg",
|
| 350 |
"assets/images/man_park.jpg",
|
|
|
|
| 351 |
"a pose image of a person running",
|
| 352 |
"",
|
| 353 |
-
"a photo of a man running in a park",
|
| 354 |
-
0.4, 0.6,
|
| 355 |
],
|
| 356 |
[
|
| 357 |
"assets/images/fruit_bowl.jpg",
|
| 358 |
"assets/images/grapes.jpg",
|
|
|
|
| 359 |
"a photo of a bowl of fruits",
|
| 360 |
"",
|
| 361 |
-
"a photo of a bowl of grapes in the trees",
|
| 362 |
-
0.6, 0.6,
|
| 363 |
],
|
| 364 |
[
|
| 365 |
"assets/images/bear_avocado__spatext.jpg",
|
| 366 |
None,
|
|
|
|
| 367 |
"a segmentation map of a bear and an avocado",
|
| 368 |
"",
|
| 369 |
-
"a realistic photo of a bear and an avocado in a forest",
|
| 370 |
-
0.6, 0.6,
|
| 371 |
],
|
| 372 |
[
|
| 373 |
"assets/images/cat__point_cloud.jpg",
|
| 374 |
None,
|
|
|
|
| 375 |
"a 3D point cloud of a cat",
|
| 376 |
"",
|
| 377 |
-
"an embroidery of a white cat sitting on a rock under the night sky",
|
| 378 |
-
0.6, 0.6,
|
| 379 |
],
|
| 380 |
[
|
| 381 |
"assets/images/library__mesh.jpg",
|
| 382 |
None,
|
|
|
|
| 383 |
"a 3D mesh of a library",
|
| 384 |
"",
|
| 385 |
-
"a Polaroid photo of an old library, sunlight streaming in",
|
| 386 |
-
0.6, 0.6,
|
| 387 |
],
|
| 388 |
[
|
| 389 |
"assets/images/knight__humanoid.jpg",
|
| 390 |
None,
|
|
|
|
| 391 |
"a 3D model of a person holding a sword and shield",
|
| 392 |
"",
|
| 393 |
-
"a photo of a medieval soldier standing on a barren field, raining",
|
| 394 |
-
0.6, 0.6,
|
| 395 |
],
|
| 396 |
[
|
| 397 |
"assets/images/person__mesh.jpg",
|
| 398 |
None,
|
|
|
|
| 399 |
"a 3D mesh of a person",
|
| 400 |
"",
|
| 401 |
-
"a photo of a Karate man performing in a cyberpunk city at night",
|
| 402 |
-
0.5, 0.6,
|
| 403 |
],
|
| 404 |
],
|
| 405 |
[
|
| 406 |
structure_image,
|
| 407 |
appearance_image,
|
|
|
|
| 408 |
structure_prompt,
|
| 409 |
appearance_prompt,
|
| 410 |
-
prompt,
|
| 411 |
-
structure_schedule,
|
| 412 |
-
appearance_schedule,
|
| 413 |
],
|
| 414 |
examples_per_page=50,
|
| 415 |
-
cache_examples="lazy"
|
|
|
|
| 416 |
)
|
| 417 |
|
| 418 |
app.launch(debug=False, share=False)
|
|
|
|
| 160 |
|
| 161 |
@spaces.GPU
|
| 162 |
def inference(
|
| 163 |
+
structure_image,
|
| 164 |
+
appearance_image,
|
| 165 |
+
prompt,
|
| 166 |
+
structure_prompt,
|
| 167 |
+
appearance_prompt,
|
| 168 |
+
positive_prompt="high quality",
|
| 169 |
+
negative_prompt="ugly, blurry, dark, low res, unrealistic",
|
| 170 |
+
guidance_scale=5.0,
|
| 171 |
+
structure_guidance_scale=5.0,
|
| 172 |
+
appearance_guidance_scale=5.0,
|
| 173 |
+
num_inference_steps=28,
|
| 174 |
+
eta=1.0,
|
| 175 |
+
seed=42,
|
| 176 |
+
width=1024,
|
| 177 |
+
height=1024,
|
| 178 |
+
structure_schedule=0.6,
|
| 179 |
+
appearance_schedule=0.6,
|
| 180 |
+
use_advanced_config=False,
|
| 181 |
+
control_config="",
|
| 182 |
progress=gr.Progress(track_tqdm=True)
|
| 183 |
):
|
| 184 |
torch.manual_seed(seed)
|
|
|
|
| 319 |
[
|
| 320 |
"assets/images/horse__point_cloud.jpg",
|
| 321 |
"assets/images/horse.jpg",
|
| 322 |
+
"a photo of a horse standing on grass",
|
| 323 |
"a 3D point cloud of a horse",
|
| 324 |
"",
|
|
|
|
|
|
|
| 325 |
],
|
| 326 |
[
|
| 327 |
"assets/images/cat__mesh.jpg",
|
| 328 |
"assets/images/tiger.jpg",
|
| 329 |
+
"a photo of a tiger standing on snow",
|
| 330 |
"a 3D mesh of a cat",
|
| 331 |
"",
|
|
|
|
|
|
|
| 332 |
],
|
| 333 |
[
|
| 334 |
"assets/images/dog__sketch.jpg",
|
| 335 |
"assets/images/squirrel.jpg",
|
| 336 |
+
"a photo of a squirrel",
|
| 337 |
"a sketch of a dog",
|
| 338 |
"",
|
|
|
|
|
|
|
| 339 |
],
|
| 340 |
[
|
| 341 |
"assets/images/living_room__seg.jpg",
|
| 342 |
"assets/images/van_gogh.jpg",
|
| 343 |
+
"a Van Gogh painting of a living room",
|
| 344 |
"a segmentation map of a living room",
|
| 345 |
"",
|
|
|
|
|
|
|
| 346 |
],
|
| 347 |
[
|
| 348 |
"assets/images/bedroom__sketch.jpg",
|
| 349 |
"assets/images/living_room_modern.jpg",
|
| 350 |
"a sketch of a bedroom",
|
|
|
|
| 351 |
"a photo of a modern bedroom during sunset",
|
| 352 |
+
"",
|
| 353 |
],
|
| 354 |
[
|
| 355 |
"assets/images/running__pose.jpg",
|
| 356 |
"assets/images/man_park.jpg",
|
| 357 |
+
"a photo of a man running in a park",
|
| 358 |
"a pose image of a person running",
|
| 359 |
"",
|
|
|
|
|
|
|
| 360 |
],
|
| 361 |
[
|
| 362 |
"assets/images/fruit_bowl.jpg",
|
| 363 |
"assets/images/grapes.jpg",
|
| 364 |
+
"a photo of a bowl of grapes in the trees",
|
| 365 |
"a photo of a bowl of fruits",
|
| 366 |
"",
|
|
|
|
|
|
|
| 367 |
],
|
| 368 |
[
|
| 369 |
"assets/images/bear_avocado__spatext.jpg",
|
| 370 |
None,
|
| 371 |
+
"a realistic photo of a bear and an avocado in a forest",
|
| 372 |
"a segmentation map of a bear and an avocado",
|
| 373 |
"",
|
|
|
|
|
|
|
| 374 |
],
|
| 375 |
[
|
| 376 |
"assets/images/cat__point_cloud.jpg",
|
| 377 |
None,
|
| 378 |
+
"an embroidery of a white cat sitting on a rock under the night sky",
|
| 379 |
"a 3D point cloud of a cat",
|
| 380 |
"",
|
|
|
|
|
|
|
| 381 |
],
|
| 382 |
[
|
| 383 |
"assets/images/library__mesh.jpg",
|
| 384 |
None,
|
| 385 |
+
"a Polaroid photo of an old library, sunlight streaming in",
|
| 386 |
"a 3D mesh of a library",
|
| 387 |
"",
|
|
|
|
|
|
|
| 388 |
],
|
| 389 |
[
|
| 390 |
"assets/images/knight__humanoid.jpg",
|
| 391 |
None,
|
| 392 |
+
"a photo of a medieval soldier standing on a barren field, raining",
|
| 393 |
"a 3D model of a person holding a sword and shield",
|
| 394 |
"",
|
|
|
|
|
|
|
| 395 |
],
|
| 396 |
[
|
| 397 |
"assets/images/person__mesh.jpg",
|
| 398 |
None,
|
| 399 |
+
"a photo of a Karate man performing in a cyberpunk city at night",
|
| 400 |
"a 3D mesh of a person",
|
| 401 |
"",
|
|
|
|
|
|
|
| 402 |
],
|
| 403 |
],
|
| 404 |
[
|
| 405 |
structure_image,
|
| 406 |
appearance_image,
|
| 407 |
+
prompt,
|
| 408 |
structure_prompt,
|
| 409 |
appearance_prompt,
|
|
|
|
|
|
|
|
|
|
| 410 |
],
|
| 411 |
examples_per_page=50,
|
| 412 |
+
cache_examples="lazy",
|
| 413 |
+
outputs=[result, result_refiner, structure_recon, appearance_recon]
|
| 414 |
)
|
| 415 |
|
| 416 |
app.launch(debug=False, share=False)
|