> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ag2.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.agentchat.contrib.capabilities.generate_images.DalleImageGenerator

<h2 id="autogen.agentchat.contrib.capabilities.generate_images.DalleImageGenerator" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

  <span class="doc doc-object-name doc-class-name">DalleImageGenerator</span>
</h2>

```python theme={null}
DalleImageGenerator(
    llm_config: LLMConfig | dict[str, Any],
    resolution: Literal['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792'] = '1024x1024',
    quality: Literal['standard', 'hd'] = 'standard',
    num_images: int = 1
)
```

Generates images using OpenAI's DALL-E models.<br />This class provides a convenient interface for generating images based on textual prompts using OpenAI's DALL-E
models. It allows you to specify the DALL-E model, resolution, quality, and the number of images to generate.<br />Note: Current implementation does not allow you to edit a previously existing image.<br />

<b>Parameters:</b>

| Name         | Description                                                                                                         |
| ------------ | ------------------------------------------------------------------------------------------------------------------- |
| `llm_config` | **Type:** [LLMConfig](/docs/api-reference/autogen/llm_config/LLMConfig) \| dict\[str, typing.Any]                   |
| `resolution` | **Type:** Literal\['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792']<br /><br />**Default:** '1024x1024' |
| `quality`    | **Type:** Literal\['standard', 'hd']<br /><br />**Default:** 'standard'                                             |
| `num_images` | **Type:** int<br /><br />**Default:** 1                                                                             |

### Instance Methods

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### cache\_key

```python theme={null}
cache_key(self, prompt: str) -> str
```

<b>Parameters:</b>

| Name     | Description   |
| -------- | ------------- |
| `prompt` | **Type:** str |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### generate\_image

```python theme={null}
generate_image(self, prompt: str) -> Image
```

<b>Parameters:</b>

| Name     | Description   |
| -------- | ------------- |
| `prompt` | **Type:** str |

<br />
