Skip to content

Commit 40c4945

Browse files
Merge pull request #647 from cdpark/refresh-sept-patrickfarley-4
Feature 308280: Q&M: AI Services freshness for 180d target - Batch 4
2 parents ebc4cf6 + a15b97c commit 40c4945

File tree

1 file changed

+23
-28
lines changed

1 file changed

+23
-28
lines changed

articles/ai-services/openai/how-to/dall-e.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ ms.author: pafarley
77
ms.service: azure-ai-openai
88
ms.custom:
99
ms.topic: how-to
10-
ms.date: 03/04/2024
10+
ms.date: 10/02/2024
1111
manager: nitinme
1212
keywords:
1313
zone_pivot_groups:
1414
# Customer intent: as an engineer or hobbyist, I want to know how to use DALL-E image generation models to their full capability.
1515
---
1616

17-
# Learn how to work with the DALL-E models
17+
# How to work with the DALL-E models
1818

1919
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.
2020

@@ -23,14 +23,14 @@ OpenAI's DALL-E models generate images based on user-provided text prompts. This
2323

2424
#### [DALL-E 3](#tab/dalle3)
2525

26-
- An Azure subscription. <a href="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.
2929

3030
#### [DALL-E 2 (preview)](#tab/dalle2)
3131

32-
- An Azure subscription. <a href="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).
3434

3535
---
3636

@@ -41,14 +41,13 @@ The following command shows the most basic way to use DALL-E with code. If this
4141

4242
#### [DALL-E 3](#tab/dalle3)
4343

44-
4544
Send a POST request to:
4645

4746
```
4847
https://<your_resource_name>.openai.azure.com/openai/deployments/<your_deployment_name>/images/generations?api-version=<api_version>
4948
```
5049

51-
where:
50+
**Replace the following placeholders**:
5251
- `<your_resource_name>` is the name of your Azure OpenAI resource.
5352
- `<your_deployment_name>` is the name of your DALL-E 3 model deployment.
5453
- `<api_version>` is the version of the API you want to use. For example, `2024-02-01`.
@@ -82,7 +81,7 @@ First, send a POST request to:
8281
https://<your_resource_name>.openai.azure.com/openai/images/generations:submit?api-version=<api_version>
8382
```
8483

85-
where:
84+
**Replace the following placeholders**:
8685
- `<your_resource_name>` is the name of your Azure OpenAI resource.
8786
- `<api_version>` is the version of the API you want to use. For example, `2023-06-01-preview`.
8887

@@ -106,7 +105,7 @@ The operation returns a `202` status code and a JSON object containing the ID an
106105

107106
```json
108107
{
109-
"id": "f508bcf2-e651-4b4b-85a7-58ad77981ffa",
108+
"id": "3d3d3d3d-4444-eeee-5555-6f6f6f6f6f6f",
110109
"status": "notRunning"
111110
}
112111
```
@@ -117,7 +116,7 @@ To retrieve the image generation results, make a GET request to:
117116
GET https://<your_resource_name>.openai.azure.com/openai/operations/images/<operation_id>?api-version=<api_version>
118117
```
119118

120-
where:
119+
**Replace the following placeholders**:
121120
- `<your_resource_name>` is the name of your Azure OpenAI resource.
122121
- `<operation_id>` is the ID of the operation returned in the previous step.
123122
- `<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.
135134

136135
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.
137136

138-
139137
#### [DALL-E 3](#tab/dalle3)
140138

141139
```json
@@ -173,7 +171,6 @@ The output from a successful image generation API call looks like the following
173171
---
174172

175173

176-
177174
### API call rejection
178175

179176
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
202199
"code": "contentFilter",
203200
"message": "Your task failed as a result of our safety system."
204201
},
205-
"id": "9484f239-9a05-41ba-997b-78252fec4b34",
202+
"id": "4e4e4e4e-5555-ffff-6666-7a7a7a7a7a7a",
206203
"status": "failed"
207204
}
208205
```
209206

210207
---
211208

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:
213210

214211
#### [DALL-E 3](#tab/dalle3)
215212

@@ -230,7 +227,7 @@ It's also possible that the generated image itself is filtered. In this case, th
230227
{
231228
"created": 1589478378,
232229
"expires": 1589478399,
233-
"id": "9484f239-9a05-41ba-997b-78252fec4b34",
230+
"id": "4e4e4e4e-5555-ffff-6666-7a7a7a7a7a7a",
234231
"lastActionDateTime": 1589478378,
235232
"data": [
236233
{
@@ -251,7 +248,7 @@ It's also possible that the generated image itself is filtered. In this case, th
251248

252249
## Writing image prompts
253250

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.
255252

256253
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).
257254

@@ -269,24 +266,23 @@ The following API body parameters are available for DALL-E image generation.
269266

270267
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.
271268

272-
273269
### Style
274270

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.
276272

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.
278274

279275
The default value is `vivid`.
280276

281277
### Quality
282278

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.
284280

285281
The default value is `standard`.
286282

287283
### Number
288284

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.
290286

291287
### Response format
292288

@@ -300,18 +296,17 @@ Specify the size of the generated images. Must be one of `256x256`, `512x512`, o
300296

301297
### Number
302298

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.
304300

305301
---
306302

307-
## Next steps
303+
## Related content
308304

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)
311307
* [Image generation API reference](/azure/ai-services/openai/reference#image-generation)
312308

313309

314310
<!-- OAI HT guide https://platform.openai.com/docs/guides/images/usage
315311
dall-e 3 features here: https://cookbook.openai.com/articles/what_is_new_with_dalle_3 -->
316312

317-

0 commit comments

Comments
 (0)