Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -381,7 +381,7 @@ def preprocess_image(input: Image.Image) -> Image.Image:
|
|
| 381 |
|
| 382 |
|
| 383 |
@spaces.GPU(duration=60)
|
| 384 |
-
def preprocess_images(images
|
| 385 |
"""
|
| 386 |
Preprocess a list of input images for multi-image conditioning.
|
| 387 |
"""
|
|
@@ -409,7 +409,7 @@ def unpack_state(state: dict) -> Tuple[SparseTensor, SparseTensor, int]:
|
|
| 409 |
return shape_slat, tex_slat, state['res']
|
| 410 |
|
| 411 |
|
| 412 |
-
def get_seed(randomize_seed
|
| 413 |
"""
|
| 414 |
Get the random seed.
|
| 415 |
"""
|
|
@@ -485,26 +485,26 @@ def split_image(image: Image.Image) -> List[Image.Image]:
|
|
| 485 |
|
| 486 |
@spaces.GPU(duration=120)
|
| 487 |
def image_to_3d(
|
| 488 |
-
seed
|
| 489 |
-
resolution
|
| 490 |
-
ss_guidance_strength
|
| 491 |
-
ss_guidance_rescale
|
| 492 |
-
ss_sampling_steps
|
| 493 |
-
ss_rescale_t
|
| 494 |
-
shape_slat_guidance_strength
|
| 495 |
-
shape_slat_guidance_rescale
|
| 496 |
-
shape_slat_sampling_steps
|
| 497 |
-
shape_slat_rescale_t
|
| 498 |
-
tex_slat_guidance_strength
|
| 499 |
-
tex_slat_guidance_rescale
|
| 500 |
-
tex_slat_sampling_steps
|
| 501 |
-
tex_slat_rescale_t
|
| 502 |
-
multiimages
|
| 503 |
-
multiimage_algo
|
| 504 |
-
tex_multiimage_algo
|
| 505 |
req: gr.Request,
|
| 506 |
progress=gr.Progress(track_tqdm=True),
|
| 507 |
-
)
|
| 508 |
if not multiimages:
|
| 509 |
raise gr.Error("Please upload images or select an example first.")
|
| 510 |
|
|
@@ -628,12 +628,12 @@ def image_to_3d(
|
|
| 628 |
|
| 629 |
@spaces.GPU(duration=120)
|
| 630 |
def extract_glb(
|
| 631 |
-
state
|
| 632 |
-
decimation_target
|
| 633 |
-
texture_size
|
| 634 |
req: gr.Request,
|
| 635 |
progress=gr.Progress(track_tqdm=True),
|
| 636 |
-
)
|
| 637 |
"""
|
| 638 |
Extract a GLB file from the 3D model.
|
| 639 |
|
|
|
|
| 381 |
|
| 382 |
|
| 383 |
@spaces.GPU(duration=60)
|
| 384 |
+
def preprocess_images(images):
|
| 385 |
"""
|
| 386 |
Preprocess a list of input images for multi-image conditioning.
|
| 387 |
"""
|
|
|
|
| 409 |
return shape_slat, tex_slat, state['res']
|
| 410 |
|
| 411 |
|
| 412 |
+
def get_seed(randomize_seed, seed):
|
| 413 |
"""
|
| 414 |
Get the random seed.
|
| 415 |
"""
|
|
|
|
| 485 |
|
| 486 |
@spaces.GPU(duration=120)
|
| 487 |
def image_to_3d(
|
| 488 |
+
seed,
|
| 489 |
+
resolution,
|
| 490 |
+
ss_guidance_strength,
|
| 491 |
+
ss_guidance_rescale,
|
| 492 |
+
ss_sampling_steps,
|
| 493 |
+
ss_rescale_t,
|
| 494 |
+
shape_slat_guidance_strength,
|
| 495 |
+
shape_slat_guidance_rescale,
|
| 496 |
+
shape_slat_sampling_steps,
|
| 497 |
+
shape_slat_rescale_t,
|
| 498 |
+
tex_slat_guidance_strength,
|
| 499 |
+
tex_slat_guidance_rescale,
|
| 500 |
+
tex_slat_sampling_steps,
|
| 501 |
+
tex_slat_rescale_t,
|
| 502 |
+
multiimages,
|
| 503 |
+
multiimage_algo,
|
| 504 |
+
tex_multiimage_algo,
|
| 505 |
req: gr.Request,
|
| 506 |
progress=gr.Progress(track_tqdm=True),
|
| 507 |
+
):
|
| 508 |
if not multiimages:
|
| 509 |
raise gr.Error("Please upload images or select an example first.")
|
| 510 |
|
|
|
|
| 628 |
|
| 629 |
@spaces.GPU(duration=120)
|
| 630 |
def extract_glb(
|
| 631 |
+
state,
|
| 632 |
+
decimation_target,
|
| 633 |
+
texture_size,
|
| 634 |
req: gr.Request,
|
| 635 |
progress=gr.Progress(track_tqdm=True),
|
| 636 |
+
):
|
| 637 |
"""
|
| 638 |
Extract a GLB file from the 3D model.
|
| 639 |
|