|
1 | 1 | # stable-diffusion-webui-api
|
2 | 2 |
|
3 |
| -This repo shows how to use stable-diffusion-webui to build Amazon SageMaker Docker image for inference and training job and how to generate images based on the combination with Stable-diffusion models and ControlNet / Lora models. |
| 3 | +## Overview |
4 | 4 |
|
5 |
| -You will find 2 Jupyter Notebooks: 1 for sync ControlNet / Lora inference, and 1 for async ControlNet / Lora inference. |
| 5 | +In this notebook, we will explore how to build generative fill application and host Stable Diffusion/ ControlNet / segment anything models on SageMaker asynchronous endpoint using DLC container. |
6 | 6 |
|
7 |
| -Note: Amazon Web Services has no control or authority over the third-party generative AI service referenced in this Workshop, and does not make any representations or warranties that the third-party generative AI service is secure, virus-free, operational, or compatible with your production environment and standards. You are responsible for making your own independent assessment of the content provided in this Workshop, and take measures to ensure that you comply with your own specific quality control practices and standards, and the local rules, laws, regulations, licenses and terms of use that apply to you, your content, and the third-party generative AI service referenced in this Workshop. The content of this Workshop: (a) is for informational purposes only, (b) represents current Amazon Web Services product offerings and practices, which are subject to change without notice, and (c) does not create any commitments or assurances from Beijing Sinnet Technology Co., Ltd. (“Sinnet”), Ningxia Western Cloud Data Technology Co., Ltd. (“NWCD”), Amazon Connect Technology Services (Beijing) Co., Ltd. (“Amazon”), or their respective affiliates, suppliers or licensors. Amazon Web Services’ content, products or services are provided “as is” without warranties, representations, or conditions of any kind, whether express or implied. The responsibilities and liabilities of Sinnet, NWCD or Amazon to their respective customers are controlled by the applicable customer agreements. |
| 7 | +You will find 2 Jupyter Notebooks: 1 for running with Amazon SageMaker Studio and 1 for running with Amazon SageMaker Notebook. |
| 8 | + |
| 9 | +## IAM role recommendations |
| 10 | + |
| 11 | +1) Running with Amazon SageMaker Studio |
| 12 | + |
| 13 | +* Permissions policies |
| 14 | + |
| 15 | + ``` |
| 16 | + AmazonSageMakerFullAccess |
| 17 | + AmazonEC2ContainerRegistryFullAccess |
| 18 | + AWSCodeBuildAdminAccess |
| 19 | + IAMFullAccess |
| 20 | + ``` |
| 21 | +
|
| 22 | +* Trusted entities |
| 23 | +
|
| 24 | + ``` |
| 25 | + { |
| 26 | + "Version": "2012-10-17", |
| 27 | + "Statement": [ |
| 28 | + { |
| 29 | + "Effect": "Allow", |
| 30 | + "Principal": { |
| 31 | + "Service": [ |
| 32 | + "sagemaker.amazonaws.com", |
| 33 | + "codebuild.amazonaws.com" |
| 34 | + ] |
| 35 | + }, |
| 36 | + "Action": "sts:AssumeRole" |
| 37 | + } |
| 38 | + ] |
| 39 | + } |
| 40 | + ``` |
| 41 | +
|
| 42 | +* Tested image, kernel, and instance: |
| 43 | + ``` |
| 44 | + image: Pytorch 2.0.1 Python 3.10 CPU Optimized |
| 45 | + kernel: Python 3 |
| 46 | + instance: ml.m5.4xlarge |
| 47 | + |
| 48 | + ``` |
| 49 | +
|
| 50 | +2) Running with Amazon SageMaker Notebook |
| 51 | +
|
| 52 | +* Permission Policies |
| 53 | +
|
| 54 | + ``` |
| 55 | + AmazonSageMakerFullAccess |
| 56 | + AmazonEC2ContainerRegistryFullAccess |
| 57 | + ``` |
| 58 | +
|
| 59 | +* Trusted entities |
| 60 | +
|
| 61 | + ``` |
| 62 | + { |
| 63 | + "Version": "2012-10-17", |
| 64 | + "Statement": [ |
| 65 | + { |
| 66 | + "Effect": "Allow", |
| 67 | + "Principal": { |
| 68 | + "Service": [ |
| 69 | + "ecs.amazonaws.com", |
| 70 | + "sagemaker.amazonaws.com" |
| 71 | + ] |
| 72 | + }, |
| 73 | + "Action": "sts:AssumeRole" |
| 74 | + } |
| 75 | + ] |
| 76 | + } |
| 77 | + ``` |
| 78 | +
|
| 79 | +* Tested kernel: |
| 80 | + ``` |
| 81 | + kernel: conda_pytorch_p310 |
| 82 | + |
| 83 | + ``` |
| 84 | +
|
| 85 | +## Note |
| 86 | +
|
| 87 | +1. You may need to adjust IAM roles definition to achieve fine grained access control. |
| 88 | +
|
| 89 | +2. Amazon Web Services has no control or authority over the third-party generative AI service referenced in this Workshop, and does not make any representations or warranties that the third-party generative AI service is secure, virus-free, operational, or compatible with your production environment and standards. You are responsible for making your own independent assessment of the content provided in this Workshop, and take measures to ensure that you comply with your own specific quality control practices and standards, and the local rules, laws, regulations, licenses and terms of use that apply to you, your content, and the third-party generative AI service referenced in this Workshop. The content of this Workshop: (a) is for informational purposes only, (b) represents current Amazon Web Services product offerings and practices, which are subject to change without notice, and (c) does not create any commitments or assurances from Beijing Sinnet Technology Co., Ltd. (“Sinnet”), Ningxia Western Cloud Data Technology Co., Ltd. (“NWCD”), Amazon Connect Technology Services (Beijing) Co., Ltd. (“Amazon”), or their respective affiliates, suppliers or licensors. Amazon Web Services’ content, products or services are provided “as is” without warranties, representations, or conditions of any kind, whether express or implied. The responsibilities and liabilities of Sinnet, NWCD or Amazon to their respective customers are controlled by the applicable customer agreements. |
0 commit comments