You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/dall-e.md
+23-28Lines changed: 23 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,14 @@ ms.author: pafarley
7
7
ms.service: azure-ai-openai
8
8
ms.custom:
9
9
ms.topic: how-to
10
-
ms.date: 03/04/2024
10
+
ms.date: 10/02/2024
11
11
manager: nitinme
12
12
keywords:
13
13
zone_pivot_groups:
14
14
# Customer intent: as an engineer or hobbyist, I want to know how to use DALL-E image generation models to their full capability.
15
15
---
16
16
17
-
# Learn how to work with the DALL-E models
17
+
# How to work with the DALL-E models
18
18
19
19
OpenAI's DALL-E models generate images based on user-provided text prompts. This guide demonstrates how to use the DALL-E models and configure their options through REST API calls.
20
20
@@ -23,14 +23,14 @@ OpenAI's DALL-E models generate images based on user-provided text prompts. This
23
23
24
24
#### [DALL-E 3](#tab/dalle3)
25
25
26
-
- An Azure subscription. <ahref="https://azure.microsoft.com/free/ai-services"target="_blank">Create one for free</a>.
27
-
- An Azure OpenAI resource created in the `SwedenCentral`region.
28
-
-Then, you need to deploy a `dalle3` model with your Azure resource. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
26
+
- An Azure subscription. You can [create one for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?icid=ai-services).
27
+
- An Azure OpenAI resource created in the *Sweden Central*region. For more information, see [Create and deploy an Azure OpenAI Service resource](../how-to/create-resource.md).
28
+
-Deploy a *dall-e-3* model with your Azure OpenAI resource.
29
29
30
30
#### [DALL-E 2 (preview)](#tab/dalle2)
31
31
32
-
- An Azure subscription. <ahref="https://azure.microsoft.com/free/ai-services"target="_blank">Create one for free</a>.
33
-
- An Azure OpenAI resource created in the East US region. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
32
+
- An Azure subscription. You can [create one for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?icid=ai-services).
33
+
- An Azure OpenAI resource created in the *East US* region. For more information, see [Create and deploy an Azure OpenAI Service resource](../how-to/create-resource.md).
34
34
35
35
---
36
36
@@ -41,14 +41,13 @@ The following command shows the most basic way to use DALL-E with code. If this
-`<your_resource_name>` is the name of your Azure OpenAI resource.
87
86
-`<api_version>` is the version of the API you want to use. For example, `2023-06-01-preview`.
88
87
@@ -106,7 +105,7 @@ The operation returns a `202` status code and a JSON object containing the ID an
106
105
107
106
```json
108
107
{
109
-
"id": "f508bcf2-e651-4b4b-85a7-58ad77981ffa",
108
+
"id": "3d3d3d3d-4444-eeee-5555-6f6f6f6f6f6f",
110
109
"status": "notRunning"
111
110
}
112
111
```
@@ -117,7 +116,7 @@ To retrieve the image generation results, make a GET request to:
117
116
GET https://<your_resource_name>.openai.azure.com/openai/operations/images/<operation_id>?api-version=<api_version>
118
117
```
119
118
120
-
where:
119
+
**Replace the following placeholders**:
121
120
-`<your_resource_name>` is the name of your Azure OpenAI resource.
122
121
-`<operation_id>` is the ID of the operation returned in the previous step.
123
122
-`<api_version>` is the version of the API you want to use. For example, `2023-06-01-preview`.
@@ -135,7 +134,6 @@ The response from this API call contains your generated image.
135
134
136
135
The output from a successful image generation API call looks like the following example. The `url` field contains a URL where you can download the generated image. The URL stays active for 24 hours.
137
136
138
-
139
137
#### [DALL-E 3](#tab/dalle3)
140
138
141
139
```json
@@ -173,7 +171,6 @@ The output from a successful image generation API call looks like the following
173
171
---
174
172
175
173
176
-
177
174
### API call rejection
178
175
179
176
Prompts and images are filtered based on our content policy, returning an error when a prompt or image is flagged.
@@ -202,14 +199,14 @@ If your prompt is flagged, the `error.code` value in the message is set to `cont
202
199
"code": "contentFilter",
203
200
"message": "Your task failed as a result of our safety system."
204
201
},
205
-
"id": "9484f239-9a05-41ba-997b-78252fec4b34",
202
+
"id": "4e4e4e4e-5555-ffff-6666-7a7a7a7a7a7a",
206
203
"status": "failed"
207
204
}
208
205
```
209
206
210
207
---
211
208
212
-
It's also possible that the generated image itself is filtered. In this case, the error message is set to `Generated image was filtered as a result of our safety system.`. Here's an example:
209
+
It's also possible that the generated image itself is filtered. In this case, the error message is set to *Generated image was filtered as a result of our safety system*. Here's an example:
213
210
214
211
#### [DALL-E 3](#tab/dalle3)
215
212
@@ -230,7 +227,7 @@ It's also possible that the generated image itself is filtered. In this case, th
230
227
{
231
228
"created": 1589478378,
232
229
"expires": 1589478399,
233
-
"id": "9484f239-9a05-41ba-997b-78252fec4b34",
230
+
"id": "4e4e4e4e-5555-ffff-6666-7a7a7a7a7a7a",
234
231
"lastActionDateTime": 1589478378,
235
232
"data": [
236
233
{
@@ -251,7 +248,7 @@ It's also possible that the generated image itself is filtered. In this case, th
251
248
252
249
## Writing image prompts
253
250
254
-
Your image prompts should describe the content you want to see in the image, as well as the visual style of image.
251
+
Your image prompts should describe the content you want to see in the image, and the visual style of image.
255
252
256
253
When writing prompts, consider that the image generation APIs come with a content moderation filter. If the service recognizes your prompt as harmful content, it doesn't generate an image. For more information, see [Content filtering](../concepts/content-filter.md).
257
254
@@ -269,24 +266,23 @@ The following API body parameters are available for DALL-E image generation.
269
266
270
267
Specify the size of the generated images. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for DALL-E 3 models. Square images are faster to generate.
271
268
272
-
273
269
### Style
274
270
275
-
DALL-E 3 introduces two style options: `natural` and `vivid`. The `natural` style is more similar to the DALL-E 2 default style, while the `vivid` style generates more hyper-real and cinematic images.
271
+
DALL-E 3 introduces two style options: `natural` and `vivid`. The natural style is more similar to the DALL-E 2 default style, while the vivid style generates more hyper-real and cinematic images.
276
272
277
-
The `natural` style is useful in cases where DALL-E 3 over-exaggerates or confuses a subject that's meant to be more simple, subdued, or realistic.
273
+
The natural style is useful in cases where DALL-E 3 over-exaggerates or confuses a subject that's meant to be more simple, subdued, or realistic.
278
274
279
275
The default value is `vivid`.
280
276
281
277
### Quality
282
278
283
-
There are two options for image quality: `hd` and `standard`. `hd`creates images with finer details and greater consistency across the image. `standard` images can be generated faster.
279
+
There are two options for image quality: `hd` and `standard`. The hd option creates images with finer details and greater consistency across the image. Standard images can be generated faster.
284
280
285
281
The default value is `standard`.
286
282
287
283
### Number
288
284
289
-
With DALL-E 3, you cannot generate more than one image in a single API call: the _n_ parameter must be set to `1`. If you need to generate multiple images at once, make parallel requests.
285
+
With DALL-E 3, you can't generate more than one image in a single API call: the `n` parameter must be set to *1*. If you need to generate multiple images at once, make parallel requests.
290
286
291
287
### Response format
292
288
@@ -300,18 +296,17 @@ Specify the size of the generated images. Must be one of `256x256`, `512x512`, o
300
296
301
297
### Number
302
298
303
-
Set the _n_ parameter to an integer between 1 and 10 to generate multiple images at the same time using DALL-E 2. The images will share an operation ID; you receive them all with the same retrieval API call.
299
+
Set the `n` parameter to an integer between 1 and 10 to generate multiple images at the same time using DALL-E 2. The images share an operation ID; you receive them all with the same retrieval API call.
304
300
305
301
---
306
302
307
-
## Next steps
303
+
## Related content
308
304
309
-
*[Learn more about Azure OpenAI](../overview.md).
310
-
*[DALL-E quickstart](../dall-e-quickstart.md)
305
+
*[What is Azure OpenAI Service?](../overview.md)
306
+
*[Quickstart: Generate images with Azure OpenAI Service](../dall-e-quickstart.md)
311
307
*[Image generation API reference](/azure/ai-services/openai/reference#image-generation)
0 commit comments