Skip to content

Service · inherits Instance

GenerationService

Official docs ↗

Service that allows developers to generate 3D objects from text prompts.

About GenerationService

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.

Methods 3

  • GenerateModelAsync(inputs: Dictionary, schema: Dictionary, options: Dictionary?) → TupleYieldsEnables generation of multi-mesh geometries according to provided inputs and a schema.

    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 LuaGlobals.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.

  • LoadGeneratedMeshAsync(generationId: string) → MeshPartYieldsRetrieves and loads a mesh generated by GenerationService.GenerateMeshAsync using the provided generationId.

    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.

  • SegmentMeshAsync(meshPart: MeshPart, schema: Dictionary, options: Dictionary?) → TupleYieldsSegments an existing MeshPart into multiple named parts according to a provided schema, returning a Model organized by the schema groups.

    Segments an existing MeshPart into multiple named parts according to a provided schema and returns a Model with the segmented parts organized by the schema groups.

    The schema parameter accepts the same structure as GenerateModelAsync(): either a PredefinedSchema string (such as "Car5" for a five-part vehicle chassis or "Body1" for a single-mesh output) or a SchemaDefinition table with a Groups array of custom part names.

    This method can only be called from Roblox Studio (edit mode or plugin context). For published mesh assets, the caller must have edit permission for the asset. Wrap calls in LuaGlobals.pcall to handle errors such as permission failures or mesh export issues.

GenerationService also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.