Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
a3c6a70
1
Parent(s):
93b0f21
update
Browse files
app.py
CHANGED
|
@@ -75,7 +75,7 @@ def get_seed(randomize_seed: bool, seed: int) -> int:
|
|
| 75 |
return np.random.randint(0, MAX_SEED) if randomize_seed else seed
|
| 76 |
|
| 77 |
|
| 78 |
-
@spaces.GPU(duration=
|
| 79 |
def image_to_3d(
|
| 80 |
image: Image.Image,
|
| 81 |
seed: int,
|
|
@@ -188,7 +188,7 @@ def extract_glb(
|
|
| 188 |
remesh=True,
|
| 189 |
remesh_band=1,
|
| 190 |
use_tqdm=True,
|
| 191 |
-
)
|
| 192 |
now = datetime.now()
|
| 193 |
timestamp = now.strftime("%Y-%m-%dT%H%M%S") + f".{now.microsecond // 1000:03d}"
|
| 194 |
os.makedirs(user_dir, exist_ok=True)
|
|
@@ -231,8 +231,8 @@ css = """
|
|
| 231 |
with gr.Blocks(delete_cache=(600, 600)) as demo:
|
| 232 |
gr.Markdown("""
|
| 233 |
## Image to 3D Asset with [TRELLIS.2](https://microsoft.github.io/trellis.2)
|
| 234 |
-
* Upload an image and click
|
| 235 |
-
* If you
|
| 236 |
""")
|
| 237 |
|
| 238 |
with gr.Row():
|
|
|
|
| 75 |
return np.random.randint(0, MAX_SEED) if randomize_seed else seed
|
| 76 |
|
| 77 |
|
| 78 |
+
@spaces.GPU(duration=120)
|
| 79 |
def image_to_3d(
|
| 80 |
image: Image.Image,
|
| 81 |
seed: int,
|
|
|
|
| 188 |
remesh=True,
|
| 189 |
remesh_band=1,
|
| 190 |
use_tqdm=True,
|
| 191 |
+
)
|
| 192 |
now = datetime.now()
|
| 193 |
timestamp = now.strftime("%Y-%m-%dT%H%M%S") + f".{now.microsecond // 1000:03d}"
|
| 194 |
os.makedirs(user_dir, exist_ok=True)
|
|
|
|
| 231 |
with gr.Blocks(delete_cache=(600, 600)) as demo:
|
| 232 |
gr.Markdown("""
|
| 233 |
## Image to 3D Asset with [TRELLIS.2](https://microsoft.github.io/trellis.2)
|
| 234 |
+
* Upload an image (preferably with an alpha-masked foreground object) and click Generate to create a 3D asset.
|
| 235 |
+
* If you're satisfied with the result, click Extract GLB to export and download the generated GLB file.
|
| 236 |
""")
|
| 237 |
|
| 238 |
with gr.Row():
|