Spaces:
Sleeping
Sleeping
| from gradio_client import Client, handle_file | |
| import time | |
| # Client with download_files=False | |
| try: | |
| client = Client("JeffreyXiang/TRELLIS", download_files=False) | |
| print("Client connected.") | |
| # Use a reliable public URL | |
| image_url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" | |
| print(f"Using image URL: {image_url}") | |
| print("--- 1. Image to 3D ---") | |
| result_video = client.predict( | |
| image=handle_file(image_url), | |
| multiimages=[], | |
| seed=0, | |
| ss_guidance_strength=7.5, | |
| ss_sampling_steps=12, | |
| slat_guidance_strength=3.0, | |
| slat_sampling_steps=12, | |
| multiimage_algo="stochastic", | |
| api_name="/image_to_3d" | |
| ) | |
| print(f"Video Result (Raw): {result_video}") | |
| # If successful, try to extract GLB | |
| print("--- 2. Extract GLB ---") | |
| result_glb = client.predict( | |
| mesh_simplify=0.95, | |
| texture_size=1024, | |
| api_name="/extract_glb" | |
| ) | |
| print(f"GLB Result (Raw): {result_glb}") | |
| except Exception as e: | |
| print(f"ERROR: {e}") | |
| # print full traceback | |
| import traceback | |
| traceback.print_exc() | |