Text to Material
To generate PBR textures, you must first create an albedo preview texture. After choosing an appropriate texture, you can optimize the task to generate all PBR maps.
The Text to Material Task object
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the task.
- Name
status
- Type
- string
- Description
The task status. Can be either
queued
,in_progress
,succeeded
orfailed
.
- Name
seed
- Type
- integer
- Description
The seed used to create the task.
- Name
prompt
- Type
- string
- Description
The text prompt used when creating the task.
- Name
negativePrompt
- Type
- string
- Description
The negative text prompt uesd when creating the task.
- Name
urls
- Type
- object
- Description
An object containing links to the assets that have been created.
- Name
albedo
- Type
- string
- Description
URL to the albedo/color map .png image.
- Name
normal
- Type
- string
- Description
URL to the normal map .png image.
- Name
displacement
- Type
- string
- Description
URL to the displacement map .png image.
- Name
metalness
- Type
- string
- Description
URL to the metalness map .png image.
- Name
roughness
- Type
- string
- Description
URL to the roughness map .png image.
- Name
ao
- Type
- string
- Description
URL to the ambient occlusion map .png image.
- Name
creditsUsed
- Type
- integer
- Description
The amount of credits used by creating this task.
- Name
finishedAt
- Type
- timestamp
- Description
Timestamp of when the task finished processing. Will be null if the task is not yet processed.
- Name
createdAt
- Type
- timestamp
- Description
Timestamp of when the task was created.
Create a preview task
This endpoint allows you to create a preview task.
Required attributes
- Name
prompt
- Type
- string
- Description
Positive text prompt that describes what the outpush texture should look like.
Optional attributes
- Name
seed
- Type
- integer
- Description
When you use the same prompt and seed, you will generate the same result. If null or omitted, the server chooses a random seed.
- Name
negativePrompt
- Type
- string
- Description
Negative text that the AI model should avoid when creating the material.
Request
curl --request POST \
--url https://api.goneural.ai/v1/material \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "string",
"seed": 42
}'
Response
{
"id": "7ea86276-8857-4284-938e-3b19c96519a8",
"status": "queued",
"seed": 42,
"prompt": "string",
"negativePrompt": null,
"urls": {},
"creditsUsed": 0,
"finishedAt": null,
"createdAt": "2024-07-20T18:06:31+00:00"
}
Optimize a task
This endpoint allows you to optimize a preview task, which will create the PBR textures.
Path parameters
- Name
task
- Type
- uuid
- Description
The id of the preview task you want to optimize.
Request
curl --request POST \
--url https://api.goneural.ai/v1/material/c7908b81-10f6-45bf-9639-501c69043c07/optimize \
--header 'Accept: application/json' \
--header 'Authorization: Bearer Dk6cNsCTy5PG1elL8F0xrmwNTExdVC87rnHAn6QVa8d8c5b0' \
--header 'Content-Type: application/json' \
--data '{}'
Response
{
"id": "c7908b81-10f6-45bf-9639-501c69043c07",
"status": "succeeded",
"seed": 17340321,
"prompt": "string",
"negativePrompt": null,
"urls": {
"albedo": "string",
"normal": "string",
"displacement": "string",
"metalness": "string",
"roughness": "string",
"ao": "string"
},
"creditsUsed": 0,
"finishedAt": "2024-07-20T18:10:12+00:00",
"createdAt": "2024-07-20T18:09:23+00:00"
}
Retrieve a task
This endpoint allows you to check the status of a task.
Path parameters
- Name
task
- Type
- uuid
- Description
The ID of the task you are checking.
Request
curl --request GET \
--url https://api.goneural.ai/v1/material/c7908b81-10f6-45bf-9639-501c69043c07 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>'
Response
{
"id": "c7908b81-10f6-45bf-9639-501c69043c07",
"status": "in_progress",
"seed": 0,
"prompt": "string",
"negativePrompt": null,
"urls": {},
"creditsUsed": 0,
"finishedAt": "2024-07-20T18:10:12+00:00",
"createdAt": "2024-07-20T18:09:23+00:00"
}