# Random Image Generator

The "Random Image Generator" can be used in case that there is a batch of pre-rendered images.&#x20;

The script is specific for the Artblocks Flex Engine and pulls images down from an folder hosted IPFS by Brightmoments.

* The artist must provide images uploaded via google drive
* The images are then hosted on IPFS via the Brightmoments Pinata account
* Once images are hosted, The following snippet code can be added onto the AB test/mainnet: \
  <https://gist.github.com/Spongenuity/7e24e5ec994c3fadfff68f484274ab4e>
  * This code is written using p5.js, so please ensure that this has been set in the AB config.
  * On the snippet, CID must be replaced with the CID of the hosted folder
  * Please ensure that the variable `totalImages` is the correct edition size
  * Please also ensure that `tokenId` is removed from line 30 and that&#x20;

    ```javascript
    selectImage(tokenId)
    ```

    &#x20;is replaced with

    ```javascript
    selectImage(tokenData.tokenId)
    ```

    &#x20;as per the comments on the snippet


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.brightmoments.io/artist-collaborations/artist-docs-and-onboarding/flex-engine/random-image-generator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
