Update
Browse files
app.py
CHANGED
|
@@ -33,6 +33,11 @@ TMP_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "tmp")
|
|
| 33 |
os.makedirs(TMP_DIR, exist_ok=True)
|
| 34 |
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
def start_session(req: gr.Request):
|
| 37 |
user_dir = os.path.join(TMP_DIR, str(req.session_hash))
|
| 38 |
os.makedirs(user_dir, exist_ok=True)
|
|
@@ -429,12 +434,5 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 429 |
)
|
| 430 |
|
| 431 |
|
| 432 |
-
# Launch the Gradio app
|
| 433 |
if __name__ == "__main__":
|
| 434 |
-
pipeline = TrellisImageTo3DPipeline.from_pretrained("microsoft/TRELLIS-image-large")
|
| 435 |
-
pipeline.cuda()
|
| 436 |
-
try:
|
| 437 |
-
pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
|
| 438 |
-
except:
|
| 439 |
-
pass
|
| 440 |
demo.launch(mcp_server=True)
|
|
|
|
| 33 |
os.makedirs(TMP_DIR, exist_ok=True)
|
| 34 |
|
| 35 |
|
| 36 |
+
pipeline = TrellisImageTo3DPipeline.from_pretrained("microsoft/TRELLIS-image-large")
|
| 37 |
+
pipeline.cuda()
|
| 38 |
+
pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
|
| 39 |
+
|
| 40 |
+
|
| 41 |
def start_session(req: gr.Request):
|
| 42 |
user_dir = os.path.join(TMP_DIR, str(req.session_hash))
|
| 43 |
os.makedirs(user_dir, exist_ok=True)
|
|
|
|
| 434 |
)
|
| 435 |
|
| 436 |
|
|
|
|
| 437 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
demo.launch(mcp_server=True)
|