Generate Textures on 3D model

Follow this recipe to upload 3D model and generate a 3D texture on the model:


The guide will recreate the following functionality in the Web UI via API.

Learn more about uploading via a presigned URL here

๐Ÿšง

Notice

  • Only 3D models in .OBJ format can be accepted as the file extension.

  • Models need to have a UV mapping to generate Textures. ๐Ÿ“˜ Tip

  • Already have a model uploaded? Find your model ID using the Get 3D models by user ID API endpoint

  • Use Webhooks to get notified in real time when your Textures have completed generating.

  • View your textures using the Get Texture Generation by ID API call after creating the Texture Generation.

  • Model icon preview won't appear on the Texture Generation Web UI but can still be viewed when clicked into.

Generate multiple textures for the same model example.

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations-texture \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "prompt": "sword, silver high metallic, low roughness, leather wrapped handle, black guard",
  "preview": True,
  "modelAssetId": `<YOUR_MODEL_ID>`
}

Cost

RequestCost
Preview Generation30 credits
Full Texture Generation150 credits