Skip to content

Retexture

Solve the problem of 3D models having "skin but no meat." Automatically generate UV layouts and fill them with high-quality textures for existing 3D meshes. Achieve precise material coverage based on text descriptions or reference images.

Typical Application Scenarios

  • Character Skinning: Quickly generate different skin styles (cyberpunk, retro, mecha) for existing characters.
  • Low-Cost Material Creation: Transform white-box props into finished assets with realistic textures.

API Reference used on this page POST /3d_models/textures

3D Model Input Formats

Model parameters accept three formats:

  • Previous task result: Use the asset_path from a text/image-to-3D task directly — no re-upload needed
  • Base64 encoding: Pass the raw base64-encoded .glb file content (no data: prefix)
  • Public URL: Any accessible .glb or supported format file link

Basic Examples

bash
curl -X POST 'https://api.v2fun.ai/api/v1/3d_models/textures' \
  -H 'Authorization: Bearer $V2FUN_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
      "input_model": "models/example.glb",
      "prompt": "A beautiful sunset over the mountains"
    }'
javascript
const response = await fetch('https://api.v2fun.ai/api/v1/3d_models/textures', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $V2FUN_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "input_model": "models/example.glb",
    "prompt": "A beautiful sunset over the mountains"
  }),
});
const data = await response.json();
python
import requests

resp = requests.post(
    'https://api.v2fun.ai/api/v1/3d_models/textures',
    headers={
        'Authorization': 'Bearer $V2FUN_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        "input_model": "models/example.glb",
        "prompt": "A beautiful sunset over the mountains"
    },
)
print(resp.json())
java
import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
String body = "{\"input_model\":\"models/example.glb\",\"prompt\":\"A beautiful sunset over the mountains\"}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.v2fun.ai/api/v1/3d_models/textures"))
    .header("Authorization", "Bearer $V2FUN_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

Core Use Cases

Text-Based Texturing

Describe target materials in natural language. The AI will complete UV mapping and generate semantically correct textures, like "an ancient rusty iron sword".

bash
curl -X POST 'https://api.v2fun.ai/api/v1/3d_models/textures' \
  -H 'Authorization: Bearer $V2FUN_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
      "input_model": "https://asset.v2fun.ai/upload/retex-input-gamepad.glb",
      "prompt": "golden luxury gamepad with diamond-encrusted buttons, ornate metallic sheen"
    }'
javascript
const response = await fetch('https://api.v2fun.ai/api/v1/3d_models/textures', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $V2FUN_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "input_model": "https://asset.v2fun.ai/upload/retex-input-gamepad.glb",
    "prompt": "golden luxury gamepad with diamond-encrusted buttons, ornate metallic sheen"
  }),
});
const data = await response.json();
python
import requests

resp = requests.post(
    'https://api.v2fun.ai/api/v1/3d_models/textures',
    headers={
        'Authorization': 'Bearer $V2FUN_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        "input_model": "https://asset.v2fun.ai/upload/retex-input-gamepad.glb",
        "prompt": "golden luxury gamepad with diamond-encrusted buttons, ornate metallic sheen"
    },
)
print(resp.json())
java
import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
String body = "{\"input_model\":\"https://asset.v2fun.ai/upload/retex-input-gamepad.glb\",\"prompt\":\"golden luxury gamepad with diamond-encrusted buttons, ornate metallic sheen\"}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.v2fun.ai/api/v1/3d_models/textures"))
    .header("Authorization", "Bearer $V2FUN_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Input Model
Output

Reference Image Texturing

Upload a reference image and the AI will extract its texture details and apply them to your 3D model.

bash
curl -X POST 'https://api.v2fun.ai/api/v1/3d_models/textures' \
  -H 'Authorization: Bearer $V2FUN_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
      "input_model": "https://asset.v2fun.ai/upload/retex-input-gamepad.glb",
      "input_image": "https://asset.v2fun.ai/upload/demo-input-texture-ref.png"
    }'
javascript
const response = await fetch('https://api.v2fun.ai/api/v1/3d_models/textures', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $V2FUN_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "input_model": "https://asset.v2fun.ai/upload/retex-input-gamepad.glb",
    "input_image": "https://asset.v2fun.ai/upload/demo-input-texture-ref.png"
  }),
});
const data = await response.json();
python
import requests

resp = requests.post(
    'https://api.v2fun.ai/api/v1/3d_models/textures',
    headers={
        'Authorization': 'Bearer $V2FUN_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        "input_model": "https://asset.v2fun.ai/upload/retex-input-gamepad.glb",
        "input_image": "https://asset.v2fun.ai/upload/demo-input-texture-ref.png"
    },
)
print(resp.json())
java
import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
String body = "{\"input_model\":\"https://asset.v2fun.ai/upload/retex-input-gamepad.glb\",\"input_image\":\"https://asset.v2fun.ai/upload/demo-input-texture-ref.png\"}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.v2fun.ai/api/v1/3d_models/textures"))
    .header("Authorization", "Bearer $V2FUN_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Texture Reference
Texture Reference
Input Model
Output

Preserve Original UV Layout

If your model already has a manually optimized UV unwrap, enabling keep_uv prevents the AI from re-cutting the UVs, keeping texture distribution fully under control. Ideal for production pipelines with precise UV requirements.

bash
curl -X POST 'https://api.v2fun.ai/api/v1/3d_models/textures' \
  -H 'Authorization: Bearer $V2FUN_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
      "input_model": "https://asset.v2fun.ai/upload/keepuv-input-roseCarvedBuildingBlock.glb",
      "prompt": "ancient Roman stone relief carving style, weathered marble texture, classical Roman ornamental motifs, stone-carved bas-relief finish",
      "keep_uv": true
    }'
javascript
const response = await fetch('https://api.v2fun.ai/api/v1/3d_models/textures', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $V2FUN_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "input_model": "https://asset.v2fun.ai/upload/keepuv-input-roseCarvedBuildingBlock.glb",
    "prompt": "ancient Roman stone relief carving style, weathered marble texture, classical Roman ornamental motifs, stone-carved bas-relief finish",
    "keep_uv": true
  }),
});
const data = await response.json();
python
import requests

resp = requests.post(
    'https://api.v2fun.ai/api/v1/3d_models/textures',
    headers={
        'Authorization': 'Bearer $V2FUN_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        "input_model": "https://asset.v2fun.ai/upload/keepuv-input-roseCarvedBuildingBlock.glb",
        "prompt": "ancient Roman stone relief carving style, weathered marble texture, classical Roman ornamental motifs, stone-carved bas-relief finish",
        "keep_uv": true
    },
)
print(resp.json())
java
import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
String body = "{\"input_model\":\"https://asset.v2fun.ai/upload/keepuv-input-roseCarvedBuildingBlock.glb\",\"prompt\":\"ancient Roman stone relief carving style, weathered marble texture, classical Roman ornamental motifs, stone-carved bas-relief finish\",\"keep_uv\":true}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.v2fun.ai/api/v1/3d_models/textures"))
    .header("Authorization", "Bearer $V2FUN_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Input Model (Original UV)
Output

PBR Materials & HD Upscaling

Generate a full PBR texture set with HD upscaling in one click, achieving fine metallic or surface detail.

bash
curl -X POST 'https://api.v2fun.ai/api/v1/3d_models/textures' \
  -H 'Authorization: Bearer $V2FUN_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
      "input_model": "https://asset.v2fun.ai/upload/retex-input-cat.glb",
      "prompt": "ancient terracotta warrior statue, hand-painted clay texture with gold and red lacquer details",
      "pbr_texture": true,
      "hd_texture": true
    }'
javascript
const response = await fetch('https://api.v2fun.ai/api/v1/3d_models/textures', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $V2FUN_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "input_model": "https://asset.v2fun.ai/upload/retex-input-cat.glb",
    "prompt": "ancient terracotta warrior statue, hand-painted clay texture with gold and red lacquer details",
    "pbr_texture": true,
    "hd_texture": true
  }),
});
const data = await response.json();
python
import requests

resp = requests.post(
    'https://api.v2fun.ai/api/v1/3d_models/textures',
    headers={
        'Authorization': 'Bearer $V2FUN_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        "input_model": "https://asset.v2fun.ai/upload/retex-input-cat.glb",
        "prompt": "ancient terracotta warrior statue, hand-painted clay texture with gold and red lacquer details",
        "pbr_texture": true,
        "hd_texture": true
    },
)
print(resp.json())
java
import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
String body = "{\"input_model\":\"https://asset.v2fun.ai/upload/retex-input-cat.glb\",\"prompt\":\"ancient terracotta warrior statue, hand-painted clay texture with gold and red lacquer details\",\"pbr_texture\":true,\"hd_texture\":true}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.v2fun.ai/api/v1/3d_models/textures"))
    .header("Authorization", "Bearer $V2FUN_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Input Model
Output