Skip to content

Commit 98170ad

Browse files
vivekmadan2Ashwin Krishna
authored andcommitted
pinned version for image generation notebook (#282)
* pinned version for image generation notebook * re-triggered test * pinned version * dummy commit
1 parent 33dc29f commit 98170ad

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

introduction_to_amazon_algorithms/jumpstart_inpainting/Amazon_JumpStart_Inpainting.ipynb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{
1212
"attachments": {},
1313
"cell_type": "markdown",
14+
"id": "b9888123",
1415
"metadata": {},
1516
"source": [
1617
"---\n",
@@ -54,7 +55,7 @@
5455
"source": [
5556
"Note: This notebook was tested on ml.t3.medium instance in Amazon SageMaker Studio with Python 3 (Data Science) kernel and in Amazon SageMaker Notebook instance with conda_python3 kernel.\n",
5657
"\n",
57-
"Note: After you\u2019re done running the notebook, make sure to delete all resources so that all the resources that you created in the process are deleted and your billing is stopped. Code in [Clean up the endpoint](#5.-Clean-up-the-endpoint) deletes model and endpoints that are created."
58+
"Note: After you’re done running the notebook, make sure to delete all resources so that all the resources that you created in the process are deleted and your billing is stopped. Code in [Clean up the endpoint](#5.-Clean-up-the-endpoint) deletes model and endpoints that are created."
5859
]
5960
},
6061
{
@@ -143,7 +144,7 @@
143144
},
144145
"outputs": [],
145146
"source": [
146-
"model_id, model_version = \"model-inpainting-stabilityai-stable-diffusion-2-inpainting-fp16\", \"*\""
147+
"model_id, model_version = \"model-inpainting-stabilityai-stable-diffusion-2-inpainting-fp16\", \"1.*\""
147148
]
148149
},
149150
{
@@ -220,7 +221,7 @@
220221
"outputs": [],
221222
"source": [
222223
"# model_version=\"*\" fetches the latest version of the model\n",
223-
"model_id, model_version = model_dropdown.value, \"*\""
224+
"model_id, model_version = model_dropdown.value, \"1.*\""
224225
]
225226
},
226227
{
@@ -546,6 +547,7 @@
546547
"***\n",
547548
"In this tutorial, we learnt how to deploy a pre-trained Stable Diffusion inpainting model on SageMaker using JumpStart. We saw that Stable Diffusion models is very effective at replacing part of the image and generating highly photo-realistic images. JumpStart provides both Stable Diffusion 1 and Stable Diffusion 2 and their FP16 revisions for inpainting. \n",
548549
"\n",
550+
"\n",
549551
"You can tweak the image generation process by selecting the appropriate parameters during inference. Guidance on how to set these parameters is provided in Supported Inference parameters section. \n",
550552
"\n",
551553
"***\n",
@@ -555,6 +557,7 @@
555557
{
556558
"attachments": {},
557559
"cell_type": "markdown",
560+
"id": "1a470d06",
558561
"metadata": {},
559562
"source": [
560563
"## Notebook CI Test Results\n",
@@ -1112,4 +1115,4 @@
11121115
},
11131116
"nbformat": 4,
11141117
"nbformat_minor": 5
1115-
}
1118+
}

introduction_to_amazon_algorithms/jumpstart_text_to_image/Amazon_JumpStart_Text_To_Image.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
"outputs": [],
206206
"source": [
207207
"# model_version=\"*\" fetches the latest version of the model\n",
208-
"model_id, model_version = model_dropdown.value, \"*\""
208+
"model_id, model_version = model_dropdown.value, \"1.*\""
209209
]
210210
},
211211
{
@@ -810,7 +810,7 @@
810810
"# which supports finetuning.\n",
811811
"train_model_id, train_model_version, train_scope = (\n",
812812
" \"model-txt2img-stabilityai-stable-diffusion-v2-1-base\",\n",
813-
" \"*\",\n",
813+
" \"1.*\",\n",
814814
" \"training\",\n",
815815
")\n",
816816
"\n",

introduction_to_amazon_algorithms/jumpstart_text_to_image/JumpStart_Stable_Diffusion_Inference_Only.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{
1212
"attachments": {},
1313
"cell_type": "markdown",
14+
"id": "d1a9149a",
1415
"metadata": {},
1516
"source": [
1617
"---\n",
@@ -201,7 +202,7 @@
201202
"outputs": [],
202203
"source": [
203204
"# model_version=\"*\" fetches the latest version of the model\n",
204-
"model_id, model_version = model_dropdown.value, \"*\""
205+
"model_id, model_version = model_dropdown.value, \"1.*\""
205206
]
206207
},
207208
{
@@ -528,7 +529,7 @@
528529
"---\n",
529530
"Writing a good prompt can sometime be an art. It is often difficult to predict whether a certain prompt will yield a satisfactory image with a given model. However, there are certain templates that have been observed to work. Broadly, a prompt can be roughly broken down into three pieces: (i) type of image (photograph/sketch/painting etc.), (ii) description (subject/object/environment/scene etc.) and (iii) the style of the image (realistic/artistic/type of art etc.). You can change each of the three parts individually to generate variations of an image. Adjectives have been known to play a significant role in the image generation process. Also, adding more details help in the generation process.\n",
530531
"\n",
531-
"To generate a realistic image, you can use phrases such as \u201ca photo of\u201d, \u201ca photograph of\u201d, \u201crealistic\u201d or \u201chyper realistic\u201d. To generate images by artists you can use phrases like \u201cby Pablo Piccaso\u201d or \u201coil painting by Rembrandt\u201d or \u201clandscape art by Frederic Edwin Church\u201d or \u201cpencil drawing by Albrecht D\u00fcrer\u201d. You can also combine different artists as well. To generate artistic image by category, you can add the art category in the prompt such as \u201clion on a beach, abstract\u201d. Some other categories include \u201coil painting\u201d, \u201cpencil drawing, \u201cpop art\u201d, \u201cdigital art\u201d, \u201canime\u201d, \u201ccartoon\u201d, \u201cfuturism\u201d, \u201cwatercolor\u201d, \u201cmanga\u201d etc. You can also include details such as lighting or camera lens such as 35mm wide lens or 85mm wide lens and details about the framing (portrait/landscape/close up etc.).\n",
532+
"To generate a realistic image, you can use phrases such as “a photo of”, “a photograph of”, “realistic” or “hyper realistic. To generate images by artists you can use phrases like “by Pablo Piccaso or “oil painting by Rembrandt or “landscape art by Frederic Edwin Church or “pencil drawing by Albrecht Dürer”. You can also combine different artists as well. To generate artistic image by category, you can add the art category in the prompt such as “lion on a beach, abstract. Some other categories include “oil painting”, “pencil drawing, “pop art”, “digital art”, “anime”, “cartoon”, “futurism”, “watercolor”, “manga” etc. You can also include details such as lighting or camera lens such as 35mm wide lens or 85mm wide lens and details about the framing (portrait/landscape/close up etc.).\n",
532533
"\n",
533534
"Note that model generates different images even if same prompt is given multiple times. So, you can generate multiple images and select the image that suits your application best.\n",
534535
"\n",
@@ -610,6 +611,7 @@
610611
{
611612
"attachments": {},
612613
"cell_type": "markdown",
614+
"id": "0f2f8a7b",
613615
"metadata": {},
614616
"source": [
615617
"## Notebook CI Test Results\n",
@@ -1167,4 +1169,4 @@
11671169
},
11681170
"nbformat": 4,
11691171
"nbformat_minor": 5
1170-
}
1172+
}

introduction_to_amazon_algorithms/jumpstart_text_to_image/custom_dog_image_generator.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
"\n",
292292
"train_model_id, train_model_version, train_scope = (\n",
293293
" \"model-txt2img-stabilityai-stable-diffusion-v2-1-base\",\n",
294-
" \"*\",\n",
294+
" \"1.*\",\n",
295295
" \"training\",\n",
296296
")\n",
297297
"\n",

introduction_to_amazon_algorithms/jumpstart_upscaling/Amazon_JumpStart_Upscaling.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{
1212
"attachments": {},
1313
"cell_type": "markdown",
14+
"id": "02ed0d4c",
1415
"metadata": {},
1516
"source": [
1617
"---\n",
@@ -55,7 +56,7 @@
5556
"source": [
5657
"Note: This notebook was tested on ml.t3.medium instance in Amazon SageMaker Studio with Python 3 (Data Science) kernel and in Amazon SageMaker Notebook instance with conda_python3 kernel.\n",
5758
"\n",
58-
"Note: After you\u2019re done running the notebook, make sure to delete all resources so that all the resources that you created in the process are deleted and your billing is stopped. Code in [Clean up the endpoint](#5.-Clean-up-the-endpoint) deletes model and endpoints that are created."
59+
"Note: After you’re done running the notebook, make sure to delete all resources so that all the resources that you created in the process are deleted and your billing is stopped. Code in [Clean up the endpoint](#5.-Clean-up-the-endpoint) deletes model and endpoints that are created."
5960
]
6061
},
6162
{
@@ -150,7 +151,7 @@
150151
"\n",
151152
"(model_id, model_version,) = (\n",
152153
" \"model-upscaling-stabilityai-stable-diffusion-x4-upscaler-fp16\",\n",
153-
" \"*\",\n",
154+
" \"1.*\",\n",
154155
")\n",
155156
"\n",
156157
"endpoint_name = name_from_base(f\"jumpstart-example-{model_id}\")\n",
@@ -183,7 +184,6 @@
183184
" predictor_cls=Predictor,\n",
184185
" name=endpoint_name,\n",
185186
")\n",
186-
"\n",
187187
"# deploy the Model. Note that we need to pass Predictor class when we deploy model through Model class,\n",
188188
"# for being able to run inference through the sagemaker API.\n",
189189
"model_predictor = model.deploy(\n",
@@ -392,7 +392,7 @@
392392
"### 4. Clean up the endpoint\n",
393393
"\n",
394394
"***\n",
395-
"After you\u2019re done running the notebook, make sure to delete all resources created in the process to ensure that the billing is stopped.\n",
395+
"After you’re done running the notebook, make sure to delete all resources created in the process to ensure that the billing is stopped.\n",
396396
"***"
397397
]
398398
},
@@ -413,6 +413,7 @@
413413
{
414414
"attachments": {},
415415
"cell_type": "markdown",
416+
"id": "65bc9f3b",
416417
"metadata": {},
417418
"source": [
418419
"## Notebook CI Test Results\n",
@@ -970,4 +971,4 @@
970971
},
971972
"nbformat": 4,
972973
"nbformat_minor": 5
973-
}
974+
}

0 commit comments

Comments
 (0)