Documentation / Node reference / geo nodes
geo/GenerativeModel
Generates a model from a text prompt or from photos, through a hosted generative API.
Files
Press generate to send the prompt (and the images, when useImages is on) to the provider. A generation costs the provider's own credits and takes minutes: nothing is ever sent by a cook, only by the button. Each press replaces the model already there, at once: it is deleted, and while the provider works the button carries a progress bar and the node shows the objects of the node named by placeholderLoading, if any. Build a loading animation anywhere in the scene and point placeholderLoading at it. If the generation fails, the node shows placeholderError instead, beside the provider's message. Both go through a geo/ObjectMerge the node creates inside itself, wired into its geo/Output, and removed when the model lands.
The node is a subnet: the result arrives as a geo/SceneGLTF child, whose Build turns the downloaded GLB into an editable sub-graph with its materials and textures. The GLB is kept under the assets root at generative/<fingerprint>.glb in the editor, which on a native build is ./public/generative/<fingerprint>.glb in the folder the editor was started from (so it is saved and exported with the project), and in your cache folder in an app built from the scene. A second press with nothing changed re-uses it instead of spending credits again.
On a native build the provider is called directly with your own API key. Press apiKey to save it, or press generate and you will be asked for it; it is kept on this computer only (~/.config/polygon/keys/<provider>, readable by you alone), never in the scene. The generation costs the credits of whoever owns that key, which is you. With useImages on, the photos come from the control panel's photo row when it holds any (uploaded or taken with the camera, in the order they were added), and from the image params otherwise.
On polygonjs.com the browser never talks to a provider at all: the request goes to Polygon's own server, which holds the keys, meters the credits and hands back a URL. That needs a Polygon Web subscription, and the button says so if the account does not have one. With useImages on, the photos come from the page, not from the node: the page lets the visitor upload them or take them with their camera, and sends them with the press, in the order they were added. The image1 to image4 params are native only and are not shown there. It sends 1 to 4 photos of the same subject; the first one matters most, because the provider takes the materials from it. A press with no photo says so, and one generation costs the same whatever the photo count. The progress bar is indeterminate there, because the provider reports a state and never a number.
Parameters
| Name | Type | What it does |
|---|---|---|
| provider | UInt8 RODIN | Which hosted API generates the model. On native it uses your own key for that provider: see apiKey. |
| prompt | String | What to generate. Required when useImages is off; optional beside images, where the provider writes its own when this is empty. |
| useImages | Bool | Off, the provider is given the prompt alone. On, it is also given one to four views of the same subject. In a browser the photos come from the page, not from the image params. On native, a control panel's photo row holding photos comes before the image params too. |
| image1 | NodePath | The tex node holding the first input image, on native. A tex/Image sends its file as it is; any other tex node is encoded to PNG first. In a browser the page supplies the photo instead, and on native so does a control panel's photo row when it holds any. |
| image2 | NodePath | A second view of the same subject. |
| image3 | NodePath | A third view of the same subject. |
| image4 | NodePath | A fourth view of the same subject. |
| quality | UInt8 MINIMUM · LOW · MEDIUM · HIGH · EXTREME_HIGH | How much the provider should spend on the result. Higher rungs cost more credits and take longer. |
| textured | Bool | Ask for a textured result. No provider can give you a bare mesh, so turning this off buys the cheapest and smallest texture the vendor has: on Rodin that saves 2 of the 3 credits an EXTREME_HIGH press costs. |
| geometryInstructMode | UInt8 CREATIVE · FAITHFUL | How literally the provider should follow the prompt or the photos. CREATIVE lets it depart from them where that gives a better model; FAITHFUL keeps it close. Rodin offers this from the MEDIUM rung up, so it is hidden below that. |
| targetPolygonCount | UInt32 | How many polygons to aim for, up to 300000. 0 leaves it to the provider, and Rodin has no recorded field for it. |
| seed | SInt32 | The provider's random seed, 0 to 65535. Below zero leaves it unseeded, so two presses give two different models. |
| generate | Button | Send the request. Costs credits (the provider's on native, the account's Polygon Web credits on polygonjs.com), takes minutes, and is disabled while a generation is running. The model already there is removed at once. |
| apiKey | Button | Save your API key for the provider, or replace or remove the saved one. The key is kept on this computer only, never in the scene, and a saved key is never shown again. Pressing generate with no key saved opens the same window. |
| placeholderLoading | NodePath | A geo node whose objects are shown in place of the model while the provider works. Typically a loading animation built elsewhere in the scene. Read when you press generate. Leave it empty to show nothing. |
| placeholderError | NodePath | A geo node whose objects are shown after a failed generation, beside the provider's message on the node. Leave it empty to show nothing. |
| _resultFingerprint | String | Bookkeeping, hidden: the fingerprint of the request whose result this node is holding, which is what makes a second identical press free. |
See also
- geo/SceneGLTF
- geo/FileGLTF
- geo/ObjectMerge
This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.