Texture generate
POST https://api.newportai.com/api/async/texture_generate
Texture generate provides the function to generate brushstokes texture by uploading a painting image. The depth infomation of the texture is integrated into the image, enabling its use for 3D printing and simulating the actual brushstrokes of the painting.
- Use Texture generate API to get taskId with POST method.
- Use Polling API to get Texture generate result with POST method.
Request Header Parameters
- Content-TypestringRequiredEnumapplication/json
- AuthorizationstringRequiredBearer authentication format, for example: Bearer
Request Body Parameters
- imageUrlstringRequiredoriginal image url.
- configobjectRequiredtexture configuration.
Response
- codeinteger0 success, or error code.
- messagestring"success", or error msg.
- dataobjecttaskIdstringUse the taskId to request the Polling API to retrieve the generated outputs.
Example
Request:
zsh
curl -X POST 'https://api.newportai.com/api/async/texture_generate' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
-d '{
"sourceImageUrl":"https://newportai-api-market.s3.amazonaws.com/demo_image/demo_image.jpg",
"config": {
"texture_blur":3,
"texture_kernel_size":3,
"texture_kernel_weight":1,
"negative_texture":false,
"texture_weight":0.1,
"normalize_range":[0,228]
}
}'
Response:
json
{
"code": 0,
"message": "success",
"data": {
"taskId": "b08337dc08d7428daa64b3d5e61b8350"
}
}
Next Step:
Use Polling API to get the result.
Demo