# Basic Image Generation

Give a prompt and the model will generate a new image.

#### [​](https://docs.heurist.ai/dev-guide/heurist-sdk/basic-image-generation#input)Input <a href="#input" id="input"></a>

Copy

```
import V from 'xalora'
 
const xalora = new Xalora({
  apiKey: process.env['XALORA_API_KEY'],
})
 
async function main() {
  const response = await xalora.images.generate({
    model: 'BrainDance',
  })
}
 
main()
```

### [​](https://docs.heurist.ai/dev-guide/heurist-sdk/basic-image-generation#response)Response <a href="#response" id="response"></a>

Copy

```
{
  "url": "https://xalora-images.s3.us-east-1.amazonaws.com/**********.png",
  "model": "BrainDance",
  "prompt": "xxxxxx"
}
```

### [​](https://docs.heurist.ai/dev-guide/heurist-sdk/basic-image-generation#parameters)Parameters <a href="#parameters" id="parameters"></a>

#### [​](https://docs.heurist.ai/dev-guide/heurist-sdk/basic-image-generation#type%3A-imagegenerateparams)Type: `ImageGenerateParams` <a href="#type-3a-imagegenerateparams" id="type-3a-imagegenerateparams"></a>

| Property         | Type     | Required | Description                                                                                                   |
| ---------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| `model`          | `string` | true     | The name of the model used, which specifies the particular model used to perform the generation or iteration. |
| `prompt`         | `string` | true     | The main cue information used to generate the image or iteration.                                             |
| `neg_prompt`     | `string` | false    | Negative cue messages used to specify that generation of content should be avoided.                           |
| `num_iterations` | `number` | false    | Number of iterations to perform. (1-50)                                                                       |
| `guidance_scale` | `number` | false    | Guidance scale for adjusting the influence of certain parameters in the generation process. (1-20)            |
| `width`          | `number` | false    | The width of the image.                                                                                       |
| `height`         | `number` | false    | The height of the image.                                                                                      |
| `seed`           | `number` | false    | Seed value to ensure repeatability of the generated results.                                                  |

***

### [​](https://docs.heurist.ai/dev-guide/heurist-sdk/basic-image-generation#returns)Returns <a href="#returns" id="returns"></a>

#### [​](https://docs.heurist.ai/dev-guide/heurist-sdk/basic-image-generation#type%3A-imagegenerateparams-%26-%7B-url%3A-string-%7D)Type: `ImageGenerateParams & { url: string }` <a href="#type-3a-imagegenerateparams-26-7b-url-3a-string-7d" id="type-3a-imagegenerateparams-26-7b-url-3a-string-7d"></a>

| Property | Type     | Required | Description                          |
| -------- | -------- | -------- | ------------------------------------ |
| `url`    | `string` | true     | The URL link to the generated image. |


---

# 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://xalora-ai.gitbook.io/xalora-ai-docs/basic-image-generation.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.
