GenerationService
Service that allows developers to generate 3D objects from text prompts.
| Memory category | Instances |
|---|
Member index 12
Removed member index 2
| History | Member |
|---|
Description
GenerationService enables you to generate 3D objects from text prompts using
Roblox's Cube 3D foundation model. This enables the generation of objects like
environmental props in-experience, as well as fully functional models like
vehicles that drive, planes that fly, and weapons that shoot.
History 17
- 726 Remove
- 726 Remove
- 721 Add UpdateVideoGenSessionTriggersAsync
- 721 Add UpdateVideoGenSessionPromptAsync
- 721 Add StartVideoGenSessionAsync
- 721 Add GetVideoGenTriggersAsync
- 721 Add GetVideoGenSessionAsync
- 721 Add DisconnectAsync
- 721 Add ConnectAsync
- 699 Add LoadModelFromGlbAsync
- 699 Add GenerateModelAsync
- 662 Add InternalGenerateMeshAsync
- 661 Add
- 661 Add
- 661 Add LoadGeneratedMeshAsync
- 661 Add GenerateMeshAsync
- 661 Add GenerationService
Members 12
ConnectAsync
| Parameters (4) | ||
|---|---|---|
| sessionId | string | |
| sdp | string | |
| type | string | |
| relay | string | |
| Returns (1) | ||
| Tuple | ||
| Thread safety | Unsafe |
|---|
History 1
- 721 Add ConnectAsync
DisconnectAsync
| Parameters (1) | ||
|---|---|---|
| sessionId | string | |
| Returns (1) | ||
| bool | ||
| Thread safety | Unsafe |
|---|
History 1
- 721 Add DisconnectAsync
GenerateMeshAsync
| Parameters (4) | ||
|---|---|---|
| inputs | Dictionary | |
| player | Player | |
| options | Dictionary | |
| intermediateResultCallback | Function? | |
| Returns (1) | ||
| Tuple | ||
Starts the generation of a new 3D mesh from a text prompt and returns
unique IDs used to track and retrieve the result. Must be called from
server scripts. You can optionally receive intermediate results, such as
the untextured mesh, by providing an intermediateResultCallback
function.
After the generation is complete, use LoadGeneratedMeshAsync() to load and display the generated mesh.
Error Codes
| Error | Description | Recommended action |
|---|---|---|
| Rate limit exceeded | The maximum number of mesh generations has been exceeded for the minute. | Wait until the rate limit resets. |
| Moderation failed | The mesh generation was flagged for moderation. | Review and modify the prompt to ensure it adheres to Roblox's moderation guidelines. |
| Internal server error | An unexpected issue occurred on the server. | Retry the request later or check server status for issues. |
| Character limit exceeded | The input prompt length for this generation request exceeded the limit. | Reduce the number of characters in the Prompt string of the input dictionary. |
| Service overloaded | The service is overloaded. | Retry the request later. |
| Size dimensions must all be greater than 0 | Invalid size provided. | Change the size to above 0. |
| Thread safety | Unsafe |
|---|
History 1
- 661 Add GenerateMeshAsync
GenerateModelAsync
| Parameters (3) | ||
|---|---|---|
| inputs | Dictionary | |
| schema | Dictionary | |
| options | Dictionary? | |
| Returns (1) | ||
| Tuple | ||
Enables generation of multi-mesh geometries according to provided inputs
and a schema.
Provide creative direction through inputs: a TextPrompt, an Image to
condition on visually, or both. Control the output structure through
schema, supplying either a built-in PredefinedSchema or a custom
SchemaDefinition that names the parts to produce.
This method throws an error during the generation process for issues like
prompt rejection, generation timeouts, schema mismatches, or backend
service errors. It's recommended to wrap it in a
pcall() to catch such errors.
See this guide for more detailed
examples including usage of a Behaviors module to connect functional
behaviors to generated models.
| Thread safety | Unsafe |
|---|
History 1
GetVideoGenSessionAsync
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| Tuple | ||
| Thread safety | Unsafe |
|---|
History 1
GetVideoGenTriggersAsync
| Parameters (2) | ||
|---|---|---|
| sessionId | string | |
| lookbackSeconds | int | |
| Returns (1) | ||
| Dictionary | ||
| Thread safety | Unsafe |
|---|
History 1
InternalGenerateMeshAsync
| Parameters (4) | ||
|---|---|---|
| inputs | Dictionary | |
| userId | int64 | |
| options | Dictionary | |
| intermediateResultCallback | Function? | |
| Returns (1) | ||
| Tuple | ||
| Security | RobloxScriptSecurity |
|---|---|
| Thread safety | Unsafe |
History 1
LoadGeneratedMeshAsync
| Parameters (1) | ||
|---|---|---|
| generationId | string | |
| Returns (1) | ||
| MeshPart | ||
Retrieves and loads a mesh generated by
GenerateMeshAsync() using
the provided generationId. Must be called from client scripts.
The mesh can be returned as a MeshPart or Model. Because
editable meshes are not replicated, the loaded mesh is not replicated to
any other clients and can only be loaded once per generationId.
| Thread safety | Unsafe |
|---|
History 1
LoadModelFromGlbAsync
| Parameters (1) | ||
|---|---|---|
| glbPath | string | |
| Returns (1) | ||
| Model | ||
| Security | RobloxScriptSecurity |
|---|---|
| Thread safety | Unsafe |
History 1
StartVideoGenSessionAsync
| Parameters (5) | ||
|---|---|---|
| sessionId | string | |
| prompt | string | |
| imageData | string | |
| imageS3Reference | string | |
| triggers | Dictionary | |
| Returns (1) | ||
| bool | ||
| Thread safety | Unsafe |
|---|
History 1
UpdateVideoGenSessionPromptAsync
| Parameters (5) | ||
|---|---|---|
| sessionId | string | |
| prompt | string | |
| imageData | string | |
| imageS3Reference | string | |
| mode | string | |
| Returns (1) | ||
| bool | ||
| Thread safety | Unsafe |
|---|
History 1
UpdateVideoGenSessionTriggersAsync
| Parameters (2) | ||
|---|---|---|
| sessionId | string | |
| triggers | Dictionary | |
| Returns (1) | ||
| bool | ||
| Thread safety | Unsafe |
|---|