The Power of Generative AI in Retail Industry
New technology is reshaping fashion retail. Here's how.
- SageMaker Jumpstart
- One-click to deploy pre-trained stable diffusion model to SageMaker Endpoint without provision.
- You can get the code from jumpstart to inference endpoint immediately or modify the code according to your scenario.
- SageMaker Notebook Instance
- Requiring only a few steps to quickly deploy a web application environment for AI-generated image generation in your AWS account with CloudFormation for one-click deployment.
- Amazon SageMaker Notebook Instance-hosted Jupyter notebook instance take care of underlying IT development environments (such as storage, networking, etc.) and infrastructure maintenance.
- The solution is built on the Stable Diffusion version 1.5, provides a great user experience with source available project usage and supports extensions based on your needs such as ControlNet.
- Users can fine-tune the model with their own image data and quickly deployed for inference using automated pipeline tools.
- All-in-one
- Requiring only a few steps to quickly deploy a web application environment for AI-generated image generation in your AWS account with CloudFormation for one-click deployment.
- Host the model on SageMaker Endpoint with auto-scaling capability to adjust the resource base on the request queues size.
- All-in-one solution can integrate with your own model seamlessly. You just upload the model to S3 bucket then it would deploy the model to SageMaker Endpoint automatically without manual configuration.
- Select the 'img2img' tab from the menu options.
- You'll find two fields: "Positive Prompt" and "Negative Prompt". In these fields, you can specify the attributes you want in your final image.
- To generate a high-quality image, it is crucial to provide detailed prompts that encompass three essential elements.
- Object: what kind of object, the object look like, color and etc..
- Scene: background, indoor, outdoor, atmosphere and etc..
- Style: photo, sketch, painting, equipments and etc.
- In the 'Positive Prompt' field, type "living room, wabi style, light, curtain, indoor, warm, photo of interior design, masterpiece, high resolution, high quality"
- In the 'Negative Prompt', you can type the attributes you do not want in your image like "low resolution, low quality, watermark, dark, dirty, messy"
- Select “inpaint upload” to upload the original photo and masked photo, so you can make the model just inpaint for the masked area.
- Click “Generate” then you will see the results


- The prompt's proximity to the beginning holds more weight in influencing the image generation process.
- Parentheses ( ) signify assigning a weight of 1.1 to the enclosed prompt, while square brackets [ ] assign a weight of 0.91.
- Multiple prompts can be linked using the "+" or "and" operators. For instance, to generate an image of a beach with people wearing sunglasses, simply type "beach+sunglasses" in the prompt.
- To combine multiple prompts, use the "|" or "or" operator. For example, generating an image of a person with green-dyed hair can be achieved by typing "(green hair: 1.1) | (black hair: 1.4)" in the prompt.
- Select the model and choose txt2img tab on the webUI
- Generate the materials with prompts separately.
- a photo of breathtaking forest scene, raining and foggy, lush forest in the mountain, muddy trail, majestic and astonishing forest scene, masterpiece, high resolution, high quality, hdr, fujifilm xt4, 50mm, f/1.6, sharp focus, high detailed
- a product photo of yellow windbreaker , masterpiece, (full body), (yellow windbreaker:1.3), sport pants, hiking boots, handsome and young man, normal eyes, high detailed face, High Detail, Sharp focus, lightly smile, nature skin, realistic, intricate, depth of field, fujifilm xt4, medium shot, hdr, 8k, highres, modelshoot style
- A photo of raining splatter on the (yellow windbreaker), (waterproof), masterpiece, high detail, high resolution, 8k, hdr, (micro shot),
- Then easily assemble the materials to an advertisement

ml.g4dn.xlarge
as example.
- one for training data
- one for generated image output
- one for model output
- Navigate to SageMaker, click the Lifecycle configuration at the left-side menu
- Select “Notebook Instance” tab and click “Create configuration”

- Type the Name and select the “Start notebook” tab then paste the following code, remember to replace your training script name

- Click “Create configuration”
- one for start up the notebook instance as the training data upload to S3
- one for stop the notebook instance as the fine-tuned model upload to S3
- Navigate to Lambda
- Click “Create function” and select Python
- Type the following code, remember to replace your notebook instance name
- Set your S3 bucket of input data as trigger with Event types:
s3:ObjectCreated:*
- Deploy the function

- Click “Create function” again and select Python
- Type the following code, remember to replace your notebook instance name
- Set your S3 bucket of model output as trigger with Event types:
s3:ObjectCreated:*
- Deploy the function

s3://<your s3 bucket of model output>
and generated image under under s3://<your s3 bucket of image output>
. You can also download the model from s3 and use in WebUI directly.

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.