Skip to content

Commit 198814c

Browse files
Merge pull request #204 from Azure-Samples/image-gen
Image gen - minor updates
2 parents f43e8fe + 8c336ed commit 198814c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

labs/image-generation/image-generation.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
"\n",
3232
"- Resources will be suffixed by a unique string based on your subscription id.\n",
3333
"- Adjust the location parameters according your preferences and on the [product availability by Azure region.](https://azure.microsoft.com/explore/global-infrastructure/products-by-region/?cdn=disable&products=cognitive-services,api-management) \n",
34-
"- Adjust the models and versions according the [availability by region.](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) "
34+
"- Adjust the models and versions according the [availability by region.](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) \n",
35+
"\n",
36+
"*Important* As of the time of this writing, GPT-Image-1 is a gated model, meaning you'll need to [submit a request](https://customervoice.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR7en2Ais5pxKtso_Pz4b1_xUQ1VGQUEzRlBIMVU2UFlHSFpSNkpOR0paRSQlQCN0PWcu) to gain access to the model, if you don't have access to GPT-Image-1, you can still use Black Forest models available in most regions"
3537
]
3638
},
3739
{
@@ -52,9 +54,9 @@
5254
"\n",
5355
"aiservices_config = [{\"name\": \"images\", \"location\": \"westus3\"}]\n",
5456
"\n",
55-
"models_config = [{\"name\": \"gpt-image-1\", \"publisher\": \"OpenAI\", \"version\": \"2025-04-15\", \"sku\": \"GlobalStandard\", \"capacity\": 1},\n",
56-
" {\"name\": \"FLUX-1.1-pro\", \"publisher\": \"Black Forest Labs\", \"version\": \"1\", \"sku\": \"GlobalStandard\", \"capacity\": 100},\n",
57-
" {\"name\": \"gpt-4.1\", \"publisher\": \"OpenAI\", \"version\": \"2025-04-14\", \"sku\": \"GlobalStandard\", \"capacity\": 100}]\n",
57+
"models_config = [{\"name\": \"gpt-4.1\", \"publisher\": \"OpenAI\", \"version\": \"2025-04-14\", \"sku\": \"GlobalStandard\", \"capacity\": 100}, ## a multi-modal chat completion model to analyze images and text\n",
58+
" {\"name\": \"gpt-image-1\", \"publisher\": \"OpenAI\", \"version\": \"2025-04-15\", \"sku\": \"GlobalStandard\", \"capacity\": 1},\n",
59+
" {\"name\": \"FLUX-1.1-pro\", \"publisher\": \"Black Forest Labs\", \"version\": \"1\", \"sku\": \"GlobalStandard\", \"capacity\": 100}]\n",
5860
"\n",
5961
"apim_sku = 'Basicv2'\n",
6062
"apim_subscriptions_config = [{\"name\": \"subscription1\", \"displayName\": \"Subscription 1\"}]\n",
@@ -284,7 +286,7 @@
284286
"metadata": {},
285287
"outputs": [],
286288
"source": [
287-
"url = f\"{apim_resource_gateway_url}/{inference_api_path}/openai/deployments/{models_config[2]['name']}/chat/completions?api-version={inference_api_version}\"\n",
289+
"url = f\"{apim_resource_gateway_url}/{inference_api_path}/openai/deployments/{models_config[0]['name']}/chat/completions?api-version={inference_api_version}\"\n",
288290
"\n",
289291
"messages = { \"messages\": [\n",
290292
" {\"role\": \"system\", \"content\": \"You are a sarcastic unhelpful assistant.\"},\n",
@@ -384,7 +386,7 @@
384386
")\n",
385387
"\n",
386388
"response = client.chat.completions.create(\n",
387-
" model = models_config[2]['name'], \n",
389+
" model = models_config[0]['name'], \n",
388390
" messages = [\n",
389391
" {\"role\": \"system\", \"content\": \"You are a sarcastic helpful assistant.\"},\n",
390392
" {\"role\": \"user\", \"content\": [\n",

0 commit comments

Comments
 (0)