MCPcopy Create free account
hub / github.com/VAST-AI-Research/tripo-python-sdk / image_to_model

Method image_to_model

tripo3d/client.py:623–695  ·  view source on GitHub ↗

Create an image to 3D model task. Args: image: The image input. Can be: - A path to a local image file - A URL to an image - An image token from previous upload model_version: The model version to use.

(
        self,
        image: str,
        model_version: Literal[
            "P1-20260311", "Turbo-v1.0-20250506",
            "v3.1-20260211", "v3.0-20250812", "v2.5-20250123",
            "v2.0-20240919", "v1.4-20240625",
        ] = "v2.5-20250123",
        face_limit: Optional[int] = None,
        texture: Optional[bool] = True,
        pbr: Optional[bool] = True,
        model_seed: Optional[int] = None,
        texture_seed: Optional[int] = None,
        texture_quality: Optional[Literal["standard", "detailed"]] = "standard",
        geometry_quality: Optional[Literal["standard", "detailed"]] = "standard",
        texture_alignment: Optional[Literal["original_image", "geometry"]] = "original_image",
        auto_size: Optional[bool] = False,
        orientation: Optional[Literal["default", "align_image"]] = "default",
        quad: Optional[bool] = False,
        compress: Optional[bool] = False,
        generate_parts: Optional[bool] = False,
        smart_low_poly: Optional[bool] = False,
        enable_image_autofix: Optional[bool] = False,
        export_uv: Optional[bool] = True,
    )

Source from the content-addressed store, hash-verified

621 return await self.create_task(task_data)
622
623 async def image_to_model(
624 self,
625 image: str,
626 model_version: Literal[
627 "P1-20260311", "Turbo-v1.0-20250506",
628 "v3.1-20260211", "v3.0-20250812", "v2.5-20250123",
629 "v2.0-20240919", "v1.4-20240625",
630 ] = "v2.5-20250123",
631 face_limit: Optional[int] = None,
632 texture: Optional[bool] = True,
633 pbr: Optional[bool] = True,
634 model_seed: Optional[int] = None,
635 texture_seed: Optional[int] = None,
636 texture_quality: Optional[Literal["standard", "detailed"]] = "standard",
637 geometry_quality: Optional[Literal["standard", "detailed"]] = "standard",
638 texture_alignment: Optional[Literal["original_image", "geometry"]] = "original_image",
639 auto_size: Optional[bool] = False,
640 orientation: Optional[Literal["default", "align_image"]] = "default",
641 quad: Optional[bool] = False,
642 compress: Optional[bool] = False,
643 generate_parts: Optional[bool] = False,
644 smart_low_poly: Optional[bool] = False,
645 enable_image_autofix: Optional[bool] = False,
646 export_uv: Optional[bool] = True,
647 ) -> str:
648 """
649 Create an image to 3D model task.
650
651 Args:
652 image: The image input. Can be:
653 - A path to a local image file
654 - A URL to an image
655 - An image token from previous upload
656 model_version: The model version to use.
657 face_limit: The maximum number of faces.
658 texture: Whether to generate texture.
659 pbr: Whether to generate PBR materials.
660 model_seed: The model seed.
661 texture_seed: The texture seed.
662 texture_quality: The texture quality.
663 geometry_quality: The geometry quality.
664 texture_alignment: The texture alignment.
665 auto_size: Whether to automatically determine the model size.
666 orientation: The orientation.
667 quad: Whether to generate a quad model.
668 compress: Whether to compress the model.
669 generate_parts: Whether to generate parts.
670 smart_low_poly: Whether to use smart low poly.
671 enable_image_autofix: Whether to auto-optimize input image quality. Default False.
672 export_uv: Whether to perform UV unwrapping during generation. Default True.
673 Returns:
674 The task ID.
675
676 Raises:
677 TripoRequestError: If the request fails.
678 TripoAPIError: If the API returns an error.
679 FileNotFoundError: If the image file does not exist.
680 ValueError: If no image is provided.

Callers 3

test_image_to_modelMethod · 0.80
mainFunction · 0.80

Calls 4

_add_optional_paramsMethod · 0.95
_get_passed_argsMethod · 0.95
create_taskMethod · 0.95

Tested by 2

test_image_to_modelMethod · 0.64