docs update: per new version

pull/847/head
MaggieGao02 2024-07-14 11:58:57 +00:00
parent 5ab3339d94
commit 321e1272b8
28 changed files with 126 additions and 684 deletions

134
README.md
View File

@ -1,114 +1,67 @@
# Extension for Stable Diffusion on AWS
This is a WebUI extension to help users migrate existing workload (inference, train, ckpt merge, etc.) from local server or standalone server to AWS Cloud.
<h1 align="center">
Extension for Stable Diffusion on AWS
</h1>
<h4 align="center">Extension for Stable Diffusion on AWS: Unlock the Power of image and video generation in the Cloud with Ease and Speed</h4>
<div align="center">
<h4>
<a href="https://github.com/awslabs/stable-diffusion-aws-extension/commits/main/stargazers"><img src="https://img.shields.io/github/stars/awslabs/stable-diffusion-aws-extension.svg?style=plasticr"></a>
<a href="https://opensource.org/license/apache-2-0"><img src="https://img.shields.io/badge/License-Apache%202.0-yellow.svg"></a>
</h4>
</div>
## How to get started:
### **Part1**: Install the stable-diffusion-webui and extension
If you have not installed the Stable Diffusion WebUI, or the proper version of the extensions this project supports, please refer to [this](./docs/Environment-Preconfiguration.md) step for setup.
This is a webUI extension to help users migrate existing workload (inference, train, etc.) from local server or standalone server to AWS Cloud. Key features include:
* Support Stable Diffusion webUI inference along with other extensions through BYOC (bring your own containers) in the cloud.
* Support LoRa model training through Kohya_ss in the cloud.
* Support ComfyUI inference along with other extensions in the cloud. This supports users in conveniently releasing templates that require stable, continuous inference to the cloud. Additionally, users can make simple modifications (e.g., prompt adjustments) to the released templates on the cloud and maintain stable inference.
### **Part2**: Install Middleware On AWS Cloud
#### **Option 1**: Use AWS Cloudformation Template
1. Install the middleware by click the [**link to navigate to AWS CloudFormation console**](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=SdWebUiMidWare&templateURL=https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/latest/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json) to install CloudFormation template directly, input the parameter accordingly, note the `Bucket` is the bucket to store all your solution assets, `Email` is the mail address you register to receive notification for events like model training complete, the `SdExtensionApiKey` is the basic authentication for your api url connection:
<img width="1377" alt="iShot_2023-06-01_14 52 51" src="https://github.com/awslabs/stable-diffusion-aws-extension/assets/2245949/3fe9469a-b9e1-4633-ac4d-ceb6a459fec5">
For users who need explicit IAM permissions for strict account control, we provide [CloudFormation template](https://github.com/awslabs/stable-diffusion-aws-extension/blob/dev/workshop/middleware-min-role.yaml) to help system administrators create IAM roles with minimal permissions, user can create & delete middleware CloudFormation templates through newly such created roles.
## Table of Contents
- [Architecture](#architecture)
- [Quick Start](#quick-start)
- [API Reference](#api-reference)
- [Version](#version)
- [License](#license)
**Create new minimum role first, e.g. sd-min-role.**
![image](https://github.com/awslabs/stable-diffusion-aws-extension/assets/23544182/148841f6-8fad-4166-8f02-8a306b177459)
**Specify such role in Cloudformation creation.**
![image](https://github.com/awslabs/stable-diffusion-aws-extension/assets/23544182/3121c876-79d4-48a2-8260-be80c480b893)
## Architecture
The diagram below presents the architecture you can automatically deploy using the solution's implementation guide and accompanying Amazon CloudFormation template.
![architecture](./docs/zh/images/middleware.png)
>**Notice** : We prefer to deploy our solution in *us-east-1* region, the reason is that in another region there is an existing S3 CORS issue which will block user to upload inference config for around 2 hours. That mean user need to wait around 2 hours after deploy the middleware to do the inference job. We will keep monitoring the progress of this issue.
1. Users in WebUI console will trigger the requests to API Gateway with assigned API token for authentication. Note that no Amazon Web Services credentials are required from WebUI perspective.
#### **Option 2**: Use AWS CDK(Cloud Development Kit)
**Prerequisites**
To set up the development environment, you will need to have AWS account and tools with a preferred version below to install from source code:
- NPM, Node
- [AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install)
- Docker
2. Amazon API Gateway will route the requests based on URL prefix to different functional Lambda to implement util jobs (for example, model upload, checkpoint merge), model training and model inferencing. In the meantime, Amazon Lambda will record the operation metadata into Amazon DynamoDB (for example, inferencing parameters, model name) for successive query and association.
1. Deploy the project to your AWS account (make sure your current profile has Administrator access, with AWS CDK, Docker installed):
3. For training process, the Amazon Step Functions will be invoked to orchestrate the training process including Amazon SageMaker for training and SNS for training status notification.
For inference process, Amazon Lambda will invoke the Amazon SageMaker to implement async inference. Training data, model and checkpoint will be stored in Amazon S3 bucket delimited with difference prefix.
```bash
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
cd infrastructure/
npm install
npx cdk bootstrap
npx cdk deploy
```
You can specify the following three parameters:
* **sub-email-address**: your subscribe email to receive notification, the email will get endpoint deployment error
* **api-token: your token** of api key for api authentication
* **util-instance-type**: c2 instance type for operations including ckpt merge, model create etc. Candidate is [**ml.r5.large, ml.r5.xlarge, ml.c6i.2xlarge, ml.c6i.4xlarge,ml.r5.large**]
```
npx cdk deploy --parameters api-token=<XXXXXXX>\
--parameters sub-email-address=<YOUREMAIL@XXX.COM>\
--parameters util-instance-type=<ml.r5.large | ml.r5.xlarge| ml.c6i.2xlarge | ml.c6i.4xlarge | ml.r5.large>
```
The project build and deployment will take about 25 minutes, and the first time can be longer due to container image packaging. Once the project is deployed successfully to your AWS account, you will see output similar below:
```text
Stable-diffusion-aws-extension-middleware-stack: creating CloudFormation changeset...
## Quick Start
✅ Stable-diffusion-aws-extension-middleware-stack
✨ Deployment time: 218.39s
Outputs:
Stable-diffusion-aws-extension-middleware-stack.ApiGatewayUrl = {API_GATEWAY_URL} // this url will needed later
Stable-diffusion-aws-extension-middleware-stack.S3BucketName = {YOUR_S3_BUCKET_LOCATION}
Stable-diffusion-aws-extension-middleware-stack.SNSTopicName = {SNS_TOPIC}
Stack ARN:
arn:aws:cloudformation:us-east-1:{ACCOUNT_NUMBER}:stack/Stable-diffusion-aws-extension-middleware-stack/{ARN}
```
5. Go to AWS CloudFormation console, find the stack you just created, click "Outputs" tab, you will see the API Gateway URL, API Token. You will need them later.
![Screen Shot 2023-05-28 at 20 35 11](https://github.com/awslabs/stable-diffusion-aws-extension/assets/23544182/743312ea-2cc8-4a2b-bfb8-dcb60cb8862e)
There are 3 key features that the extension supports. There are 2 branches of deployment method, depending on the key feature that you'd like to deploy.
## Set up the extension in WebUI console
* If you'd like to adopt SD webUI or Kohya in the cloud, please follow the instruction [here](./docs/zh/deployment/deployment.md).
* If you'd like to adopt ComfyUI in the cloud, please follow the instruction [here](./docs/zh/deployment/deployment_comfyui.md).
1. Go back the WebUI console, and choose "AWS SageMaker" tab, enter the API Gateway URL and API token you just got from CloudFormation/CDK output, click "Update Setting" and "Test Connection" button to make sure the connection is successful. Or you can create new file called ```sagemaker_ui.json``` for the same purpose, the file should be placed under stable diffusion root folder and the content should be like below:
```json
{
"api_gateway_url": "{API_GATEWAY_URL}",
"api_token": "{API_GATEWAY_KEY}"
}
```
Please refer to [**user guide**](https://awslabs.github.io/stable-diffusion-aws-extension/zh/user-guide/preparation/) for following detailed operations.
## API Reference
To provide developers with a more convenient experience for invoking and debugging APIs, we offer a feature [API debugger](./docs/en/developer-guide/api_debugger.md). With this tool, you can view the complete set of APIs and corresponding parameters for cloud-based inference images with a single click.
## Why we build such an extension
Stable Diffusion WebUI is a popular open-source GitHub project that provides an intuitive and user-friendly interface for data scientists and developers to interact with pre-trained txt2img/img2img model. The project has gained traction in the community (forks/stars/prs) for its ability to streamline the process of training, evaluating, and deploying models. As the demand for scalable and efficient machine learning solutions continues to rise, the Stable Diffusion WebUI project has emerged as a go-to tool for many user.
Some user existing workflow is shown below that the data scientists had to jump from customized WebUI, EC2 and manual scripts to accomplished a single model finetune process, which are:
* time-consuming: the model training is executed on a standalone server that leading long training time (30-40 minutes per model) and no scalable workaround;
* error prone: data training, model (CKPT) packaging, endpoint deployment, UI update, result validation are not in a single panel;
* easily out-dated: functional feature of WebUI and community extension keep evolving, making existing customized WebUI laborious to sync with upstream community;
1. Click the button to refresh the inference history job list
2. Pull down the inference job list, find and select the job
3. Click the `API` button on the right
![Screen Shot 2023-05-20 at 21 44 58](https://github.com/aws-samples/stable-diffusion-aws-extension/assets/23544182/08109af4-84b0-4055-bf19-b9e8344dba75)
![debugger](./docs/en/images/api_debugger.png)
Thus we plan to contribute a solution aiming to mitigate the above issue and provide a lite, decouple and user-friendly AWS SageMaker based extension, in response to this growing demand and specific user requirement. We integrate WebUI with AWS SageMaker, a fully managed service that allows users to build, train, and deploy machine learning models in the cloud. This extension will enable users to leverage the power of AWS SageMaker as the backend for model training and inference. With the AWS customized extension in place, Stable Diffusion WebUI will offer its users a more streamlined and cost-effective solution to optimize their existing workflows, including model training/finetune, inference and iteration with fast community pace.
The comprehensive APIs with sample can be found [here](./docs/en/developer-guide/api.md).
## What is the user tutorial
We have provided a Stable Diffusion WebUI extension and AWS middleware for user, and user will install such an extension by importing provided GitHub URL and AWS middleware by launch offered CloudFormation template in AWS console.
Brief user tutorial will be: User will first install the extension, extra tab will be installed for user to manager AWS credential, building AWS native SD model etc. then user will navigate to original txt2img tab, configure setting like CFG scale, batch count/size etc., then click 'Generate on Cloud' button to get the generated image. Thus, providing user another alternative to utilize cloud resource without break existing user experience. Please refer to [user guide](https://awslabs.github.io/stable-diffusion-aws-extension/en/) for more details.
![UIProcess](https://github.com/aws-samples/stable-diffusion-aws-extension/assets/23544182/3c6961d0-e1f9-4bee-b370-892978063781)
## Version
Check our [wiki](https://github.com/awslabs/stable-diffusion-aws-extension/wiki) for the latest & historical version
## What is the overall architecture & workflow?
Diagram below is the brief view of internal workflow between our extension and middleware, user will keep launching community WebUI onto standalone EC2/local server with our extension installed, while the training and inference part will be passed onto AWS cloud (SageMaker, S3 etc.) through the RESTful API provided by middleware installed on users AWS account. Note the middleware is per AWS account, means it could be installed separately as work node to communicate with WebUI as control node, user only need to input endpoint URL and API key per account to decide which specific AWS account will be used for successive jobs.
![workflow](https://github.com/aws-samples/stable-diffusion-aws-extension/assets/23544182/2781734c-d1fb-44c3-bc57-c0e78e128c4e)
The major function of middleware is to provide RESTful API for WebUI extension to interact with AWS cloud resource (SageMaker, S3 etc.) with OpenAPI conformant schema, it will handling the request authentication, request dispatch to specific SageMaker/S3 API (SageMaker.jumpstart/model/predictor/estimator/tuner/utils etc.) and model lifecycle.
Diagram below is the overall architecture of middleware, including API Gateway and Lambda to fulfill the RESTful API function and Step Function to orchestrate the model lifecycle.
![middleware](https://github.com/awslabs/stable-diffusion-aws-extension/assets/23544182/8d871565-5792-4a7c-87c9-53fc66d96a5c)
- Users in the WebUI console will use the assigned API token to trigger a request to API Gateway while being authenticated. (Note: AWS credentials are not required in AWS WebUI)
- API Gateway will route requests to Lambda with different functions according to URL prefixes to implement corresponding tasks (for example, model uploading, checkpoint merging), model training, and model inference. At the same time, the Lambda function records operational metadata into DynamoDB (eg, inferred parameters, model name) for subsequent query and correlation.
- During the training process, the Step Function will be called to orchestrate the training process, which includes using Amazon SageMaker for training and SNS for training status notification. During the inference process, the Lambda function will call Amazon SageMaker for asynchronous inference. Training data, models and checkpoints will be stored in S3 buckets separated by different prefixes.
## License
This project is licensed under the Apache-2.0 License.
### Source Code Structure
@ -135,5 +88,4 @@ Diagram below is the overall architecture of middleware, including API Gateway a
└── utils.py -- wrapper function for configure options
```
## Version
Check our [wiki](https://github.com/awslabs/stable-diffusion-aws-extension/wiki) for the latest & historical version

View File

@ -59,7 +59,7 @@ You can view the status of the stack in the AWS CloudFormation Console in the **
### Step2: Configure API url and API token.
After successfully stack creation, you can refer to [here](../user-guide/multi-user.md) for subsequent configuration work.
After successfully stack creation, you can refer to [here](../user-guide/webUI/multi-user.md) for subsequent configuration work.
<!-- 1. Go to [CloudFormation console](https://console.aws.amazon.com/cloudformation/).

View File

@ -1,5 +1,6 @@
| Date | Version |Changes |CloudFormation Template |
|----------------------------|-------------------|-------------------|-------------------|
| 2024/06/28 | V1.6.1| - Support **automatic template rendering** in the frontend when a published template is selected. This facilitates subsequent parameter adjustments and inference based on the selected template. <br> - Bugs fix | [V1.6.1](https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.6.1/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}
| 2024/06/14 | V1.6.0 | - Support **ComfyUI** on SageMaker <br> - Support **ComfyUI template workflow** to release and inference <br> - Support Amazon SageMaker **G6 series** inference endpoint(s) <br> - Support for saving intermediate status of **Kohya_ss** trained model <br> - Support for visual evaluation after training **Kohya_ss** model <br> - Support image caption through **WD14** <br> - Bugs fix | [V1.6.0](https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.6.0/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}
| 2024/03/22 | V1.5.0 | - Support **webUI** V1.8.0 <br> - Support extension **ReActor for Stable Diffusion** <br> - Add **API Debugger** feature <br> - Support LoRa model training through **Kohya_ss** <br> - Improve customer experience on **Resource management** in webUI <br> - Optimize the method of customizing BYOC extensions, and support optimization startup <br> - Support **auto-scale** ability for real-time inference endpoints <br> - Support the **customizable range** for the numbers of instances during auto-scaling <br> - Optimize **installation time** by 67%, down to 4 minutes <br> - Upgrade Python version from 3.9 to 3.10 <br> - Deprecate support for **Dreambooth** <br> - Bugs fix | [V1.5.0](https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.5.0/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}
| 2024/01/19 | V1.4.0 | - Support **webUI** V1.7.0 <br> - Support multiple Amazon stacks deployment in one account <br> - Enhance cold-start time of Amazon SageMaker inference time by 70%, down to 3 mins <br> - Support image generation through Amazon SageMaker **real-time inference endpoint** <br> - Improve customer experience on webUI, containing multiple level filters for tables of roles, users, models and inference endpoints, along with resource delete feature <br> - Bugs fix | [V1.4.0](https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.4.0/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}

View File

@ -1,6 +1,14 @@
## Features
This solution supports the cloud-based operations of the following native features/third-party extensions of Stable Diffusion WebUI:
This solution supports the cloud-based operations of the following 3 projects.
| **Project** | **Supported Version** | **Note**|
| ------------- | ------------- | ------------- |
|Stable Diffusion WebUI| V 1.8.0| The default supported native/third-party extensions are listed in the table below. |
|ComfyUI| 605e64f6d3da44235498bf9103d7aab1c95ef211|The custom nodes that require cloud-based inference support can be packaged and uploaded to the cloud in one click using the template publishing feature provided by this solution. Therefore, this solution does not include built-in support for custom nodes; users can flexibly choose to install and package them for upload. |
|Kohya_ss|V0.8.3|Support LoRa model training based on SD 1.5 and SDXL.|
Below please find the native features/third-party extensions supported by this solution for Stable Diffusion WebUI. Other extensions can be supported through [BYOC (Bring Your Own Container)]((../developer-guide/byoc.md)).
| **Feature** | **Supported Version** | **Note** |
| ------------- | ------------- | ------------- |

View File

@ -1,7 +1,7 @@
# Uninstall Extension for Stable Diffusion on AWS
!!! Warning "Warning"
Before uninstalling the solution, please manually delete all the Amazon SageMaker Endpoints deployed by this solution, referring to **Delete deployed endpoint** in [Main tab](./user-guide/CloudAssetsManage.md). By uninstalling the solution, the DynamoDB tables that indicate the model training, finetuning and inference logs and mapping relationship, AWS Lambda related functions, AWS Step Functions and so on will be deleted simultaneously.
Before uninstalling the solution, please manually delete all the Amazon SageMaker Endpoints deployed by this solution, referring to **Delete deployed endpoint** in [Main tab](./user-guide/webUI/CloudAssetsManage.md). By uninstalling the solution, the DynamoDB tables that indicate the model training, finetuning and inference logs and mapping relationship, AWS Lambda related functions, AWS Step Functions and so on will be deleted simultaneously.
To uninstall the Extension for Stable Diffusion on AWS solution, you must delete the AWS CloudFormation stack.

View File

@ -1,87 +0,0 @@
# Main Tab
This chapter will provide a detailed overview of the convenient cloud-based resource management approach offered by this solution.
## Upload Model
To use extra models for inference, you could upload model through steps below in two ways, and follow steps in [txt2img](txt2img-guide.md) or [img2img](img2img-guide.md)to inference with extra models as need.
Method One:
1. Within Stable Diffusion WebUI, navigate to solution main tab **Amazon SageMaker**, find session **Cloud Models Management**.
![Upload Models to S3](../images/UploadFromWebUI.png)
2. Select the **from WebUI** tab, which means to upload the model from the models file path where the WebUI service is deployed.
3. Enter the model path where the WebUI service is deployed under corresponding model text box.
> **Note**: You can upload multiple kinds of models by entering multiple local model paths in text box.
4. Click **Upload Models to Cloud** to start uploading process.
5.Message will appear on left right once uploading completes.
Method Two:
1. Within Stable Diffusion WebUI, navigate to solution main tab **Amazon SageMaker** main tab, find session **Cloud Models Management**.
![Upload Models to S3](../images/UploadFromComputer.png)
2. Select the **from Laptop** tab, which means to upload the model from the local path to access the WebUI.
3. Select the type of model to upload, currently supports six types: SD Checkpoints, Textual Inversion, LoRA model, ControlNet model, Hypernetwork, VAE
3. Select the model file to be uploaded locally.
> **Note**: You can select models multiple, but subject to browser restrictions, it is best to select no more than 10 files, and the total size should not exceed 8g.
4. Click **Upload Models to Cloud** to start uploading process.
5. The upload will be uploaded in pieces asynchronously based on the file size and quantity. After each piece is uploaded, you will see a prompt under the **Choose File** button
Method Three:
1. Within Stable Diffusion WebUI, navigate to the **Amazon SageMaker** main tab and find session **Cloud Models Management**.
2. Select the **from URL** tab. This option allows you to upload models to S3 from URLs where the models are downloaded.
![Upload Models to S3](../images/UploadFromURL.png)
3. Choose the type of model you want to upload. Currently, six types are supported: SD Checkpoints, Textual Inversion, LoRA model, ControlNet model, Hypernetwork, VAE.
4. In the **URL list (Comma-separated in English)** input box, enter the URL list of model downloads, separated by commas.
5. In the **Models Description (Optional)** input box, provide a JSON-formatted description (optional).
> **Note**: You can select multiple model files, but it's advisable not to exceed 5 files in your selection, with a total size not exceeding 12 GB, as constrained by Lambda memory and concurrent thread limits.
6. Click **Upload Models to Cloud** to start the model upload process.
7. You will see a prompt in the **Label** section below indicating the progress of the upload request.
## Amazon SageMaker Endpoint Management
### Deploy new endpoint
1. Navigate to the **Amazon SageMaker** main tab of the solution. In the **Cloud Assets Management** module, locate the **Deploy New SageMaker Endpoint** section.
2. The default deployment type for the solution is ml.g5.2xlarge, with 1 instance. The endpoint autoscaling feature is enabled by default. Simply click the **Deploy** button to initiate the deployment of the Sagemaker endpoint.
3. If users wish to specify the endpoint name, instance type, and maximum instance count for the endpoint's instances, they can check the **Advanced Endpoint Configuration** checkbox. This will display additional parameters for user input. The following table lists the names and descriptions of these parameters:
| Parameter Name | Description |
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Endpoint Name (Optional) | If you need to specify a name for the Sagemaker endpoint, enter it in this input box. If not modified, the default endpoint name will be esd-type-XXXXX. |
| Endpoint Type | Select the inference type Async/Real time for the deployed Endpoint |
| Instance Type | Select the instance type for the deployed endpoint from the dropdown list. |
| Max Instance Number | Choose the maximum number of instances for the deployed endpoint from the dropdown list. If Autoscaling is selected, Sagemaker will elastically scale between 0 and the Max Instance Number based on average CPU usage. |
| Enable Autoscaling | If this checkbox is selected, Async inference will scale elastically between 0 and Max Instance Numbers based on the average backlog of each instance, while Real-time inference will scale elastically between 1 and Max Instance Numbers based on the average number of calls per instance. |
| Min Instance Number | If Enable Autoscaling is true, This value will be the minimum number of Endpoint instances |
4. After selecting the default endpoint configuration or setting up the advanced endpoint configuration, click **Deploy**. You'll see a message indicating **Endpoint deployment started** under **Label**.
![Deploy new endpoint](../images/Deploy-new-endpoint.png)
5. You can navigate to tab **Amazon SageMaker**, session **Inference Endpoint Management**, refresh list to check all the deployment status of endpoints.
> **Note:** The format of the drop down list isendpoint name+ deployment status (including Creating/Failed/InService)+deployment completing time.
6. It will take around 3 minutes for endpoint deployment status changing to *InService*, which indicates that the endpoint has been successfully deployed.
### Delete deployed endpoints
1. Refresh and select endpoint(s) under the dropdown list of **Inference Endpoint Management**.
2. Click **Delete**, message *Endpoint delete completed* will appear on the left side, which indicates that the selected endpoint(s) has been successfully deleted.
# AWS Dataset Management
## Create Dataset
In functions such as model fine-tuning, it is necessary to provide a file of images for fine-tuning work. This functional module helps users quickly upload images to the cloud.
1. Navigate to main tab **Amazon SageMaker**, section **AWS Dataset Management**sub-tab **Create**.
![Create Dataset to S3](../images/Dataset_management.png)
2. Click **Click to Upload a File**, in the local file browser that pops up, confirm to select all the images required for one model fine-tuning.
3. Enter file name in **Dataset Name**, enter file description in **Dataset Description**, click **Create Dataset**.
4. The message **Complete Dataset XXXX creation** will be displayed on the right side once the process completes.
## Explore Dataset
After the dataset has been successfully uploaded, this feature module allows users to quickly obtain the corresponding cloud-based address of the dataset. Users can copy this address and paste it into the location where the collection of images needs to be uploaded.
1. Navigate to **Amazon SageMaker****AWS Dataset Management** session**Browse** tab, refresh the list **Dataset From Cloud** and select desired dataset.
2. Field **dataset s3 location** will display the corresponding S3 path on the cloud. User can copy to use as need.

View File

@ -1,26 +0,0 @@
# Use Controlnet for inference
You can open **controlnet** sub-session, by combining the use of native functionalities **txt2img** or **img2img** along with the added panel of **Amazon SageMaker Inference** in the solution, the inference tasks involving cloud resources can be invoked.
## Controlnet User Guide
### Multi-controlnet user guide
1. Navigate to **Settings** tab. In the left sidebar, select **ControlNet**, and adjust the **Multi ControlNet** in the right panel: Max models amount (requires restart) setting to specify the number of ControlNets (1-10). Afterward, restart the webUI for the changes to take effect, and the Multi ControlNet configuration will be active.
![Setting-Controlnet](../images/setting-multi-controlnet.png)
2. Navigate to **txt2img** or **img2img** taban equal number of ControlNet units will appear. For example, below shows 3 controlNet units started simultaneously.
![Setting-Controlnet](../images/multi-controlnet-inference.png)
### openpose User Guide
1. Open ControlNet panel, choose **ControlNet Unit 0**, check **Enable**, select **openpose** from **Preprocessor**, and then upload am image.
![Controlnet-openpose-prepare](../images/controlnet-openpose-prepare.png)
2. Similar to local inference, you can customize the inference parameters of the native **ControlNet**. The controlnet model "**control_openpose-fp16.safetensors**" should be uploaded to the cloud before generate.
3. Click **Generate on Cloud** after finished all parameters setting.
4. Refresh and select the top Inference Job from **Inference Job: Time-Type-Status-Uid**, inference result will be displayed in **Output** section.
5. Subsequent actions. You can click **Save** or others as need to perform further processing.
![generate results controlnet](../images/cute-dog-controlnet.png)

View File

@ -1,98 +0,0 @@
# SageMaker Async Endpoint Autoscaling
Amazon SageMaker provides capabilities to automatically scale model inference endpoints in response to the changes in traffic patterns. This document explains how autoscaling is enabled for an Amazon SageMaker async endpoint created by this Solution
## Overview
The solution provided enables autoscaling for a specific endpoint and variant in Amazon SageMaker. Autoscaling is managed through two scaling policies:
1. **Target Tracking Scaling Policy**: This policy adjusts the desired instance count based on the `CPUUtilization` metric. It aims to keep the CPU utilization at 50%. If the average CPU utilization is above 50 for 5 minutes, the alarm will trigger application autoscaling to scale out Sagemaker endpoint until it reach the maximum number of instances.
The scaling policy based on CPU utilization is defined using the `put_scaling_policy` method. It specifies the following parameters:
- `TargetValue`: 50% CPU utilization
- `ScaleInCooldown`: 300 seconds
- `ScaleOutCooldown`: 300 seconds
2. **Step Scaling Policy**: This policy allows you to define steps for scaling adjustments based on the `HasBacklogWithoutCapacity` metric. This policy is created to let application autoscaling increase the instance number from 0 to 1 when there is inference request but endpoint has 0 instance.
The step scaling policy is defined to adjust the capacity based on the `HasBacklogWithoutCapacity` metric. It includes:
- `AdjustmentType`: ChangeInCapacity
- `MetricAggregationType`: Average
- `Cooldown`: 300 seconds
- `StepAdjustments`: Specifies the scaling adjustments based on the size of the alarm breach.
### Example of Sagemaker async endpoint autoscaling policy below:
```json
{
"ScalingPolicies": [
{
"PolicyARN": "Your PolicyARN",
"PolicyName": "HasBacklogWithoutCapacity-ScalingPolicy",
"ServiceNamespace": "sagemaker",
"ResourceId": "endpoint/esd-type-c356f91/variant/prod",
"ScalableDimension": "sagemaker:variant:DesiredInstanceCount",
"PolicyType": "StepScaling",
"StepScalingPolicyConfiguration": {
"AdjustmentType": "ChangeInCapacity",
"StepAdjustments": [
{
"MetricIntervalLowerBound": 0.0,
"ScalingAdjustment": 1
}
],
"Cooldown": 300,
"MetricAggregationType": "Average"
},
"Alarms": [
{
"AlarmName": "stable-diffusion-hasbacklogwithoutcapacity-alarm",
"AlarmARN": "Your AlarmARN"
}
],
"CreationTime": "2023-08-14T13:53:10.480000+08:00"
},
{
"PolicyARN": "Your PolicyARN",
"PolicyName": "CPUUtil-ScalingPolicy",
"ServiceNamespace": "sagemaker",
"ResourceId": "endpoint/esd-type-c356f91/variant/prod",
"ScalableDimension": "sagemaker:variant:DesiredInstanceCount",
"PolicyType": "TargetTrackingScaling",
"TargetTrackingScalingPolicyConfiguration": {
"TargetValue": 50.0,
"CustomizedMetricSpecification": {
"MetricName": "CPUUtilization",
"Namespace": "/aws/sagemaker/Endpoints",
"Dimensions": [
{
"Name": "EndpointName",
"Value": "esd-type-c356f91"
},
{
"Name": "VariantName",
"Value": "prod"
}
],
"Statistic": "Average",
"Unit": "Percent"
},
"ScaleOutCooldown": 300,
"ScaleInCooldown": 300
},
"Alarms": [
{
"AlarmName": "TargetTracking-endpoint/esd-type-c356f91/variant/prod-AlarmHigh-c915b303-9048-40b2-99a7-f5b7e49ab7c4",
"AlarmARN": "Your AlarmARN"
},
{
"AlarmName": "TargetTracking-endpoint/esd-type-c356f91/variant/prod-AlarmLow-2fd61f99-c2e5-4ac6-9722-54030c3f0216",
"AlarmARN": "Your AlarmARN"
}
],
"CreationTime": "2023-08-14T13:53:10.182000+08:00"
}
]
}
```

View File

@ -1,36 +0,0 @@
# Other Extensions User Guide
## Extension ReActor for FaceSwap
You can open the **ReActor** tab session, combining native windows of **txt2img** or **img2img** with solution tab **Amazon SageMaker Inference**, to achieve faceswap feature on cloud.
### User Guide
Here is an example of using ReActor in **txt2img** to introduce the recommended steps.
1. Select a base model under **Stable Diffusion Checkpoint Used on Cloud**, the *Generate* button will automatically change to "generate on cloud".
2. Assuming you want to generate an image of a girl with the appearance of the Mona Lisa, fill in the prompt box with "a girl".
3. Open tab of **ReActor**, drag image of Mona Lisa into *Single Source Image*.
![Setting-Reactor](../images/reactor.png)
4. Click *Generate on cloud*, and result will be presented in **Output** session as below.
![Setting-Reactor](../images/reactor_result.png)
Reactor supports multi-face swapping simultaneously by specifying the index of the face. It also allows loading face models for swapping. For more detailed usage instructions, please refer to the [extension documentation](https://github.com/Gourieff/sd-webui-reactor){:target="_blank"}
## Extension Tiled Diffusion & Tiled VAE for Image Super Resolution
You can use tab of **Tiled VAE**, combining with native **txt2img** or **img2img** with solution tab **Amazon SageMaker Inference**, in order to achieve image super resolution work.
### User Guide
By utilizing these two extensions, it is able to generate ultra-high-resolution images within limited VRAM. Here, we'll take the example of using these extensions in **txt2img** to demonstrate how to perform super-resolution inference:
1. Select a base model under **Stable Diffusion Checkpoint Used on Cloud**, the *Generate* button will automatically change to "generate on cloud".
2. Assuming you want to generate an image of a cat, fill in the prompt box with "a cat".
3. Open Tiled Diffusion **Hires.fix**, and set the upscaling factor to 4x for super-resolution.
![Setting-tiledvae](../images/tiledvae1.png)
4. Open **Tiled VAE**Enable Tiled VAE, you can generate the image using the default parameters.
![Setting-tiledvae](../images/tiledvae2.png)
5. Click *Generate on cloud*, and result will be presented in **Output** session.
![Setting-tiledvae](../images/tiledvae_result.png)
Tiled Diffusion supports setting different prompts for different regions to generate ultra-high-resolution images. For detailed usage instructions, please refer to the [extension documentation](https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/tree/main){:target="_blank"}

View File

@ -1,87 +0,0 @@
# img2img Guide
You can open the **img2img tab** and use the original region along with the **Amazon SageMaker Inference** to perform inference on the cloud.
## img2img user guide
### Standard process for different functional labels in img2img
1. Navigate to tab **img2img**, find panel **Amazon SageMaker Inference**.
2. Input parameters for inference. The same as local inference, you could edit parameters in native fields for model name (stable diffusion checkpoint, extra networks:Lora, Hypernetworks, Textural Inversion and VAE), prompts, negative prompts, sampling parameters, inference parameters and etc. For functions **img2img**, **sketch**, **inpaint**, **inpaint sketch** and **inpaint upload**, you could upload and modify images in the native way.
!!! Important "Notice"
The model files used in the inference should be uploaded to the cloud before generate, which can be referred to the introduction of chapter **Cloud Assets Management**
3. Select Stable Diffusion checkpoint model that will be used for cloud inference through **Stable Diffusion Checkpoint Used on Cloud**, and the button **Generate** will change to button **Generate on Cloud**.
![Generate button面板](../images/txt2img-generate-button.png)
!!! Important "Notice"
This field is mandatory. If you choose an endpoint that is in any other state or leave it empty, an error will occur when you click **Generate on Cloud** to initiate cloud-based inference.
4. Click**Generate on Cloud**。
5. Check inference result. Fresh and select the top option among **Inference Job Histories: Time-Type-Status-UUID** dropdown list. The **Output** section in the top-right area of the img2img tab will display the results of the inference once completed, including the generated images, prompts, and inference parameters. Based on this, you can perform subsequent workflows such as clicking **Save** or **Send to extras**.
> **Note:** The list is sorted in reverse chronological order based on the inference time, with the most recent inference task appearing at the top. Each record is named in the format of **inference time -> job type(txt2img/img2img/interrogate_clip/interrogate_deepbooru) -> inference status(succeed/in progress/fail) ->inference id**.
### img2img label
1. Upload the original image to **img2img** and enter prompts, and click **Generate on Cloud**.
2. Select corresponding **Inference Job ID**, the generated image will present on the right **Output** session.
### Sketch label
1. Start **Stable Diffusion WebUI** with --gradio-img2img-tool color-sketch on the command lineupload the whiteboard background image to the **Sketch tab**.
2. Use a brush to draw the corresponding sketch and prepare prompts, and click **Generate on Cloud**.
![sketch paint](../images/sketch_paint.png)
3. Select corresponding **Inference Job ID**, the generated image will present on the right **Output** session.
![sketch result](../images/sketch_result.png)
### Inpaint label
1. Upload original image to **Inpaint** label.
2. Establish masks with brushes and prepare prompts, and click **Generate on Cloud**.
![inpaint_inpaint](../images/inpaint_inpaint.png)
3. Select corresponding **Inference Job ID**, the generated image will present on the right **Output** session.
![inpaint result](../images/inpaint_result.png)
### Inpaint Sketch label
1. Start **Stable Diffusion WebUI** with --gradio-img2img-tool color-sketchand upload original image into **Inpaint Sketch**label with prompts.
2. Establish masks with brushes, and click **Generate on Cloud**.
![inpaint_sketch_inpaint](../images/inpaint_sketch_inpaint.png)
3. Select corresponding **Inference Job ID**, the generated image will present on the right **Output** session.
![inpaint_sketch result](../images/inpaint_sketch_result.png)
### Inpaint Upload label
1. Upload original image and mask image to **Inpaint Upload** label and prepare prompts, for example *large eyes*.
![inpaint_upload](../images/inpaint_upload_tab.png)
2. Click **Generate on Cloud**, and select corresponding **Inference Job ID**, the generated image will present on the right **Output** session.
![inpaint_upload result](../images/inpaint_upload_result.png)
### Interrogate clip/deepbooru
1. Navigate to **img2img** tabopen **Amazon SageMaker Inference** panel.
2. Interrogate only need to upload image to **img2img** tab.
![img2img tab](../images/clip_tab.png)
3. Click **Interrogate CLIP on cloud** or **Interrogate DeepBooru on cloud**.
4. Check inference result. Refresh the dropdown list of **Inference Job JDs**, check the topmost **Inference Job ID** that match the inference submission timestamp to review the inference result.
![interrogate generate results](../images/clip.png)
### Continuous Inference Scenario
1. Following the **General Inference Scenario**, complete the parameter inputs and click **Generate on Cloud** to submit the initial inference task.
2. Wait for the appearance of a new **Inference ID** in the right-side **Output** section.
3. Once the new Inference ID appears, you can proceed to click **Generate on Cloud** again for the next inference task.
![continuous generate results](../images/continue-inference.png)

View File

@ -1,43 +0,0 @@
# Configure API and Multiple Users.
## Configure API
1. Open [AWS CloudFormation Console](https://console.aws.amazon.com/cloudformation/), and select the main stack that successfully deployed.
2. Navigate the **Outputs** tab, and copy the information under **APIGatewayUrl** and **ApiGatewayUrlToken**.
3. Open Stable Diffusion webUI, navigate to the 'Amazon SageMaker' tab, paste information from step 2 into fields **API URL** and **API Token**. Create a super admin user name and password by entering information in field **Username** and **Password**. And click **Test Connection & Update Setting**.
4. Message **Successfully Connected & Setting Updated** will be printed once front UI successfully connected with backend cloud resource. The configuration file has been updated to automatically display corresponding information upon future launches of the webUI.
## Multiple User Management
IT Operator role users can log in and navigate to the **Amazon SageMaker** tab, and then to the **API and User Settings** sub-tab to manage roles and users.
### Role Management
Under the **Role Management** tab, roles can be viewed, created, and configured with corresponding permissions. After
creating a new role, click **Next Page** or refresh the page to update the **Role Table**.
### Permissions Description
| Name | Scope | Permissions |
|------------------------|------------|-------------------------------------------------------------------------------------------|
| role:all | Role | Create role, obtain role list, delete role |
| user:all | User | Create users, obtain user lists, delete users, update users |
| sagemaker_endpoint:all | Endpoint | Create endpoints, obtain endpoint list, delete endpoints |
| inference:all | Inference | Create and start reasoning tasks, obtain reasoning task list, delete reasoning tasks |
| checkpoint:all | Checkpoint | Create model files, obtain a list of model files, delete model files |
| train:all | Training | Create training assignments, obtain training assignment list, delete training assignments | |
### Users Management
#### Add New User
1. To meet your specific requirements, create new users, passwords, and roles. Once you click on "Next Page," the newly created users will be visible. To ensure the configuration changes related to the new users take effect in the web UI server, it is necessary to restart the web UI again.
![add user](../images/multi_user/multi-user-8.png)
2. Open another incognito browser, and log in using the newly created username and password.
3. When accessing the Amazon SageMaker tab, the displayed content may vary for different users.
#### Manage Existing User
1. Select the corresponding user from **User Table** that is expected to be updated, including **Password** or **User Role** update. The user information will be displayed in field **Update a User Setting**.
2. Update the corresponding fields as need, and click **Upsert a User** to save the change. Otherwise click **Delete a User** to delete the selected user.

View File

@ -1,15 +0,0 @@
# Connect Stable Diffusion WebUI with AWS Account
## Prerequisites
You need to have successfully completed the deployment of the solution.
## Steps
1. Visit [AWS CloudFormation Console](https://console.aws.amazon.com/cloudformation/){:target="_blank"}.
2. Select the root stack of the solution you created from a stack list.
3. Open **Outputs** tab, find URL of **APIGatewayUrl** and copy。
4. Open **Stable Diffusion WebUI**, navigate to **Amazon SageMaker**tabpaste the URL copied from step 3 under **API URL
**. Paste API token copied from step 3 into field of **API Token**. Click **Update Setting***config updated to local
config!* message will appear.
5. Click **Test Connection & Update Setting**.

View File

@ -7,7 +7,7 @@ The training is based on [Kohya-SS](https://github.com/kohya-ss/sd-scripts). Koh
![Kohya Training](../images/Kohya_training.png)
### Prepare Foundation Model
Please refresh and check the dropdown list under **Model** to ensure that the required base models for this training session are available. If not, you can use the **Upload Models** in [Cloud Asset Management](./CloudAssetsManage.md) to upload the base models under the *SD Checkpoints* category.
Please refresh and check the dropdown list under **Model** to ensure that the required base models for this training session are available. If not, you can use the **Upload Models** in [Cloud Asset Management](./webUI/CloudAssetsManage.md) to upload the base models under the *SD Checkpoints* category.
Alternatively, you can also upload local SD models to an S3 bucket using the following command:
@ -26,7 +26,7 @@ Taking the example of training a LoRa model containing specific image style, use
After preprocessing, it is necessary to annotate the images in dataset, that is, add textual descriptions to each training image and save them as text files with the same name as the corresponding images. Image annotation can be complete through the built-in image annotation function in the SD WebUI or through multi-modal large models. The annotations made by the model may not be perfect, so manual review and adjustments are recommended to ensure the final effect.
Please refer **Dataset Management** in [Cloud Asset Management](./CloudAssetsManage.md) to upload dataset to cloud.
Please refer **Dataset Management** in [Cloud Asset Management](./webUI/CloudAssetsManage.md) to upload dataset to cloud.
In addition, user could also upload dataset by execute AWS CLI command to copy the dataset to S3 bucket
```
@ -41,7 +41,7 @@ After the base model and dataset have been uploaded successfully, please follow
2. Update the training parameters in **config_params**, and click **Format config Params** to check and correct updated params file format.
3. Click **Create Training Job** to submit training job.
4. Refresh **Trainings List** to follow status of training job.
5. The successfully trained LoRa model can be selected directly in **txt2img** or **img2img**, and used in image generation. More details refer to [txt2img guide](./txt2img-guide.md) or [img2img guide](./img2img-guide.md).
5. The successfully trained LoRa model can be selected directly in **txt2img** or **img2img**, and used in image generation. More details refer to [txt2img guide](./webUI/txt2img-guide.md) or [img2img guide](./webUI/img2img-guide.md).
### Train Loss Visualization
On the **Train Management** tab, all the finished training job will be listed in the **Training List**, click the training id and the logs will show the below referred to the following figure.

View File

@ -1,40 +0,0 @@
# txt2img Guide
You can open the **txt2img** tab to perform text-to-image inference using the combined functionality of the native region of txt2img and the newly added "Amazon SageMaker Inference" panel in the solution. This allows you to invoke cloud resources for txt2img inference tasks.
## txt2img user guide
### General Inference Scenario
1. Navigate to **txt2img** tab, find **Amazon SageMaker Inference** panel.
![Sagemaker Inference面板](../images/txt2img-inference.png)
2. Enter the required parameters for inference. Similar to local inference, you can customize the inference parameters of the native **txt2img**, including model name (stable diffusion checkpoint, extra networks:Lora, Hypernetworks, Textural Inversion and VAE), prompts, negative prompts, sampling parameters, and inference parameters. For VAE model switch, navigate to **Settings** tab, select **Stable Diffusion** in the left panel, and then select VAE model in **SD VAE** (choose VAE model: Automatic = use one with same filename as checkpoint; None = use VAE from checkpoint).
![Settings 面板](../images/setting-vae.png)
!!! Important "Notice"
The model files used in the inference should be uploaded to the cloud before generate, which can be referred to the introduction of chapter **Cloud Assets Management**. The current model list displays options for both local and cloud-based models. For cloud-based inference, it is recommended to select models with the **sagemaker** keyword as a suffix, indicating that they have been uploaded to the cloud for subsequent inference.
3. Select Stable Diffusion checkpoint model that will be used for cloud inference through **Stable Diffusion Checkpoint Used on Cloud**, and the button **Generate** will change to button **Generate on Cloud**.
![Generate button面板](../images/txt2img-generate-button.png)
!!! Important "Notice"
This field is mandatory.
4. Finish setting all the parameters, and then click **Generate on Cloud**.
5. Check inference result. Fresh and select the top option among **Inference Job** dropdown list, the **Output** section in the top-right area of the **txt2img** tab will display the results of the inference once completed, including the generated images, prompts, and inference parameters. Based on this, you can perform subsequent workflows such as clicking **Save** or **Send to img2img**.
> **Note** The list is sorted in reverse chronological order based on the inference time, with the most recent inference task appearing at the top. Each record is named in the format of *inference time -> inference id*.
![generate results](../../images/generate-results.png)
### Inference Using Extra Model(s) like Lora
1. Please follow the native version of WebUI, and upload a copy of the required model (including Textual Inversion, Hypernetworks, Checkpoints or Lora models) to local machine.
2. Upload corresponding models to the cloud, following [Upload Models](../CloudAssetsManage/).
3. Select the required model, adjust the weights of the model in prompts field, and click **Generate on Cloud** to inference images.
## Inference Job Histories
Inference Job displays the latest 10 inference jobs by default, following naming format Time-Type-Status-UUID. Checking **Show All** will display all inference jobs the account has. Checking **Advanced Inference Job filter** and apply filters as need will provide users a customized inference job list.
The inference API combinations and corresponding parameters for a specific historical inference task can be obtained in [API Debugger](../developer-guide/api_debugger.md)

View File

@ -23,19 +23,21 @@ nav:
- Deploy the solution:
- Permissions: deployment/permissions.md
- AWS CloudFormation template: deployment/template.md
- Deployment step: deployment/deployment.md
- Deployment step from existing resource: deployment/deployment_for_existing_users.md
- Deploy for SD webUI: deployment/deployment.md
- Deploy for ComfyUI: deployment/deployment_comfyui.md
- Update SD webUI: deployment/deployment_for_existing_users.md
#- Update the solution: update.md
- Uninstall the solution: uninstall.md
- Use the solution:
- Preparation: user-guide/preparation.md
- Configure API and Users Management: user-guide/multi-user.md
- Cloud Assets Management: user-guide/CloudAssetsManage.md
- txt2img guide: user-guide/txt2img-guide.md
- img2img guide: user-guide/img2img-guide.md
- controlNet guide: user-guide/controlnet-guide.md
- Training guide: user-guide/training-guide.md
- Other Extensions guide: user-guide/extensions-guide.md
- Kohya Training guide: user-guide/training-guide.md
- SD webUI guide:
- Configure API and Users Management: user-guide/webUI/multi-user.md
- Cloud Assets Management: user-guide/webUI/CloudAssetsManage.md
- txt2img guide: user-guide/webUI/txt2img-guide.md
- img2img guide: user-guide/webUI/img2img-guide.md
- controlNet guide: user-guide/webUI/controlnet-guide.md
- Other Extensions guide: user-guide/webUI/extensions-guide.md
- ComfyUI guide: user-guide/ComfyUI/inference.md
#- Checkpoint Merger guide: user-guide/checkpoint-merge-guide.md
- Developer guide:
- Source code: developer-guide/source.md

View File

@ -14,7 +14,7 @@ nav:
#- 术语表: solution-overview/concepts.md
- 成本预估: cost.md
- 架构概览:
- 架构图: architecture-overview/architecture.md
#- 架构图: architecture-overview/architecture.md
#- 架构设计思路: architecture-overview/design-considerations.md
- 架构细节: architecture-overview/architecture-details.md

View File

@ -14,41 +14,58 @@
- 步骤4根据创建的工作流部署新的Amazon SageMaker推理节点。
!!! tip "贴士"
遇到部署问题时可以查看[faq](../faq.md)中ComfyUI相关部分。
遇到部署问题时可以查看“常见问题解答”章节中ComfyUI相关部分。
## 部署步骤
### 步骤1: 部署解决方案中间件
此自动化Amazon CloudFormation模板在亚马逊云科技中部署解决方案。
1. 登录到[AWS管理控制台](https://console.aws.amazon.com/),点击链接[Extension-for-Stable-Diffusion-on-AWS-ComfyUI.template](https://console.aws.amazon.com/cloudformation/home?#/stacks/create/template?stackName=stable-diffusion-aws&templateURL=https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.6.0-cc5e0f3/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}。
1. 登录到[AWS管理控制台](https://console.aws.amazon.com/),点击链接[Extension for Stable Diffusion on AWS](https://console.aws.amazon.com/cloudformation/home?#/stacks/create/template?stackName=stable-diffusion-aws&templateURL=https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/latest/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}。
2. 默认情况下该模版将在您登录控制台后默认的区域启动。若需在指定的Amazon Web Service区域中启动该解决方案请在控制台导航栏中的区域下拉列表中选择。
3. 在**创建堆栈**页面上确认Amazon S3 URL文本框中显示正确的模板URL然后选择**下一步**。
4. 在**制定堆栈详细信息**页面,为您的解决方案堆栈分配一个账户内唯一且符合命名要求的名称。
5. 在**参数**部分,在**Bucket**中填入一个有效的新的S3桶的名字或之前部署的、用于本解决方案ComfyUI部分的S3桶名字。在**email**处输入一个正确的电子邮件地址,以便接收将来的通知。在**SdExtensionApiKey**字段中请输入一个包含数字和字母组合的20个字符的字符串如果未提供默认为"09876543210987654321"。在**LogLevel**处选择您心仪的Lambda Log日志打印级别默认ERROR才打印。点击**下一步**。
6. 在**配置堆栈选项**页面,选择**下一步**。
7. 在**审核**页面查看并确认设置。确保选中确认模板将创建Amazon Identity and Access ManagementIAM资源的复选框。并确保选中AWS CloudFormation需要的其它功能的复选框。选择**提交**以部署堆栈。
8. 您可以在 AWS CloudFormation 控制台的 **状态** 列中查看堆栈的状态。您应该会在大约 15 分钟内收到**CREATE_COMPLETE**状态。
4. 在**制定堆栈详细信息**页面,为您的解决方案堆栈分配一个账户内唯一且符合命名要求的名称。部署参数参考下表。点击**下一步**。
|参数|说明|建议|
|:-------------|:--------------|:--------------|
|Bucket|填入一个有效的新的S3桶的名字或之前部署的、用于本解决方案ComfyUI部分的S3桶名字||
|email|输入一个正确的电子邮件地址,以便接收将来的通知||
|SdExtensionApiKey|请输入一个包含数字和字母组合的20个字符的字符串|默认为"09876543210987654321"|
|LogLevel|择您心仪的Lambda Log日志打印级别|默认ERROR才打印|
5. 在**配置堆栈选项**页面,选择**下一步**。
6. 在**审核**页面查看并确认设置。确保选中确认模板将创建Amazon Identity and Access ManagementIAM资源的复选框。并确保选中AWS CloudFormation需要的其它功能的复选框。选择**提交**以部署堆栈。
7. 您可以在 AWS CloudFormation 控制台的 **状态** 列中查看堆栈的状态。您应该会在大约 15 分钟内收到**CREATE_COMPLETE**状态。
!!! tip "贴士"
请及时检查您预留邮箱的收件箱并在主题为“AWS Notification - Subscription Confirmation”的邮件中点击“Confirm subscription”超链接按提示完成订阅。
### 步骤2: 部署ComfyUI前端
步骤3将会为客户安装ComfyUI的前端。该前端自动内置了汉化插件、工作流发布云上等按钮为客户提供更友好的UI交互界面。此自动化Amazon CloudFormation模板在亚马逊云科技中部署解决方案。
步骤2将会为客户安装ComfyUI的前端。该前端自动内置了汉化插件、工作流发布云上等按钮为客户提供更友好的UI交互界面。此自动化Amazon CloudFormation模板在亚马逊云科技中部署。
1. 点击[链接](https://aws-gcr-solutions.s3.amazonaws.com/extension-for-stable-diffusion-on-aws/comfy.yaml){:target="_blank"}来下载ComfyUI前端部署的yaml文件。或复制此链接亦或者从步骤一的输出获取到对应部署ComfyUI前端的文件链接。
2. 登录到[AWS管理控制台](https://console.aws.amazon.com/),点击控制台右上角**Create Stack**, **With new resource(standard)**,页面跳转至创建堆栈。
3. 在**创建堆栈**页面上,选择**Choose an existing template**,在**特定模版**区域选择**Upload a template file**从本地选择选择刚下载的yaml文件上传或者是**Amazon S3 URL**,填入上述复制的链接,然后选择**下一步**。
4. 在**制定堆栈详细信息**页面,为您的解决方案堆栈分配一个账户内唯一且符合命名要求的名称。在**参数**部分,**InstanceType**为选择部署的ec2的实例类型、**NumberOfInferencePorts**为推理环境数量建议不超过5个**StackName**来自于部署步骤第一大部分中成功部署堆栈的名称。**keyPairName**选择现有的一个EC2 Key Pair点击**Next**。
1. 登录到[AWS管理控制台](https://console.aws.amazon.com/),点击控制台右上角**Create Stack**, **With new resource(standard)**,页面跳转至创建堆栈。
2. 在**创建堆栈**页面上,选择**Choose an existing template**,在**特定模版**区域选择**Amazon S3 URLe**,填入该[部署模版链接](https://aws-gcr-solutions.s3.amazonaws.com/extension-for-stable-diffusion-on-aws/comfy.yaml),然后选择**下一步**。
3. 在**制定堆栈详细信息**页面,为您的解决方案堆栈分配一个账户内唯一且符合命名要求的名称。在**参数**部分,部署参数说明如下。点击**Next**。
!!! tip "贴士"
此处的EC2 Key Pair主要用于本地远程连接EC2。如果没有现有的可以参考[官方手册](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html){:target="_blank"}来创建。
|参数|说明|建议|
|:-------------|:--------------|:--------------|
|InstanceType |部署的ec2的实例类型 | 如果是涉及推理动图、视频等建议G6、G5机器 |
|NumberOfInferencePorts|推理环境数量|建议不超过5个|
|StackName|来自于部署步骤1中成功部署堆栈的名称||
|keyPairName|选择现有的一个EC2 Key Pair||
5. 在**配置堆栈选项**页面,选择**下一步**。
6. 在**审核**页面查看并确认设置。确保选中确认模板将创建Amazon Identity and Access ManagementIAM资源的复选框。并确保选中AWS CloudFormation需要的其它功能的复选框。选择**提交**以部署堆栈。
7. 您可以在 AWS CloudFormation 控制台的 **状态** 列中查看堆栈的状态。您应该会在大约 3 分钟内收到**CREATE_COMPLETE**状态。
8. 选择部署成功的堆栈,打开**Outputs**,点击**Designer**对应的链接即可打开解决方案部署的ComfyUI前端Designer的访问可能需要关闭VPN或者去掉10000端口后访问。**NumberOfInferencePortsStart**代表推理环境地址起始路径端口按照部署数量端口地址依次增加例如当NumberOfInferencePorts填写3时地址范围时可访问的推理环境地址依次为http://EC2地址:10001http://EC2地址:10002http://EC2地址:10003
4. 在**配置堆栈选项**页面,选择**下一步**。
5. 在**审核**页面查看并确认设置。确保选中确认模板将创建Amazon Identity and Access ManagementIAM资源的复选框。并确保选中AWS CloudFormation需要的其它功能的复选框。选择**提交**以部署堆栈。
6. 您可以在 AWS CloudFormation 控制台的 **状态** 列中查看堆栈的状态。您应该会在大约 3 分钟内收到**CREATE_COMPLETE**状态。
7. 选择部署成功的堆栈,打开**Outputs**,点击**Designer**对应的链接即可打开解决方案部署的ComfyUI前端Designer的访问可能需要关闭VPN或者去掉10000端口后访问。**NumberOfInferencePortsStart**代表推理环境地址起始路径端口按照部署数量端口地址依次增加例如当NumberOfInferencePorts填写2时地址范围时可访问的推理环境地址依次为http://EC2地址:10001http://EC2地址:10002.
|角色|功能|端口|
|:-------------|:--------------|:--------------|
|主美/工作流管理| 能够安装新的custom nodes在EC2上调试工作流发布工作流、环境至Amazon SageMaker。同时可以调用SageMaker资源、选中已发布的工作流进行推理验证 | http://EC2地址|
|普通美术| 从该端口进入的界面可以选择主美已发布的工作流简单修改推理参数后勾选“Prompt on AWS”后、调用Amazon SageMaker进行推理|当NumberOfInferencePorts填写3时地址范围时可访问的推理环境地址依次为<ul><li>http://EC2地址:10001 </li><li>http://EC2地址:10002 </li><li>http://EC2地址:10003</li></ul>|
!!! tip "贴士"
刚部署好贴士以后需要稍作等待。如果打开链接后看到提示“Comfy is Initializing or Starting”表示后端在初始化ComfyUI过程中请稍作等待再次刷新页面确认。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 348 KiB

View File

@ -1,5 +1,6 @@
| 日期 | 版本号 | 版本发布说明 | CloudFormation模版地址
|----------------------------|--------|--------|--------|
| 2024年06月28日 | V1.6.1| - 新增支持已发布模版被选取时,前端**自动渲染模版**,以供后续基于此的简单参数调整推理 <br> - 修复若干已知问题 | [V1.6.1](https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.6.1/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}
| 2024年06月14日 | V1.6.0 | - 新增支持**ComfyUI** on SageMaker <br> - 新增支持云上**ComfyUI工作流模版**的发布和使用 <br> - 新增支持Amazon SageMaker **G6系列**推理节点 <br> - 新增**Kohya_ss**模型训练中间状态的保存 <br> - 新增支持**Kohya_ss**模型训练后的可视化评估 <br> - 新增支持**WD14**的图片自动打标 <br> - 修复若干已知问题 | [V1.6.0](https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.6.0/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}
| 2024年03月22日 | V1.5.0 | - 升级对**webUI**的版本支持至1.8.0 <br> - 新增支持换脸插件**ReActor for Stable Diffusion** <br> - 新增**API推理调试器功能** <br> - 新增支持**Kohya_ss**的LoRa模型训练 <br> - 优化**云上资源管理**的用户体验 <br> - 优化**BYOC自定义插件的方式**,并支持启动优化<br> - 支持实时推理节点的**弹性伸缩**功能 <br> - 支持所有实例**自定义实例数范围**,即便自动伸缩,也可以设置最小实例数,而不是 0 <br> - 优化中间件**部署时间**67%降低至4分钟 <br> - 升级Python版本从3.9至3.10 <br> - webUI**资源管理**界面用户体验优化 <br> - 修复若干已知问题 | [V1.5.0](https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.5.0/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}
| 2024年01月19日 | V1.4.0 | -升级对**webUI**的版本支持至1.7.0 <br> - 支持同一账号,**多套部署** <br> - 优化Amazon SageMaker推理节点**冷启动时间**70%缩短至3分钟 <br> - 支持通过Amazon SageMaker**实时推理节点**进行图片推理 <br> - webUI用户体验优化新增用户组、角色组、模型和推理节点列表的多维**过滤筛选**,便利的**增删**功能 <br> - 修复若干已知问题 | [V1.4.0](https://aws-gcr-solutions.s3.amazonaws.com/stable-diffusion-aws-extension-github-mainline/v1.4.0/custom-domain/Extension-for-Stable-Diffusion-on-AWS.template.json){:target="_blank"}

View File

@ -1,7 +1,12 @@
## 主要功能
本解决方案支持以下 Stable Diffusion WebUI 的原生功能/第三方插件的云上工作:
| **开源主项目** | **支持版本** | **贴士**|
| ------------- | ------------- | ------------- |
|Stable Diffusion WebUI| V 1.8.0| 默认支持的原生/第三方插件如下表 |
|ComfyUI| 605e64f6d3da44235498bf9103d7aab1c95ef211| 需要支持云上推理的custom nodes皆可通过本方案提供的模版发布功能一键打包至云上。因此本方案无内置支持的custom node用户可灵活选择安装并打包上传。|
|Kohya_ss|V0.8.3|支持基于SD 1.5 & SDXL的LoRa模型训练|
本方案支持以下 Stable Diffusion WebUI 的原生功能/第三方插件的云上工作。其他插件需求可以通过[BYOCBring Your Own Container](../developer-guide/byoc.md)来支持。
| **功能** | **支持版本** | **注释** |
| ------------- | ------------- | ------------- |

View File

@ -1,95 +0,0 @@
本章节将详细介绍本解决方案提供的便捷云上资源管理方式。
## 上传模型
如需在txt2img或img2img使用非云端推理模型您可以选择按下列两种方式的步骤完成推理模型上传即可按[txt2img](./txt2img-guide.md)或[img2img](./img2img-guide.md)相应步骤完成模型调用及推理。
### 从原生webUI上传模型至云上
考虑到用户多样的使用场景本方式适用于将webUI前端部署在非本地电脑的其他机器上的场景。同于webUI社区原生使用方式用户需要首先将相关模型上传至部署了webUI前端的机器上对应webUI项目文件夹下、models子文件夹的对应处之后即可跟从下面步骤完成模型上传到云上。
1. 进入解决方案主标签页**Amazon SageMaker**,找到**Cloud Models Management**模块。
2. 选择from WebUI标签页, 该方式表示从部署WebUI服务的models文件路径上传模型。
![Upload Models to S3](../images/UploadFromWebUI.png)
3. 在对应的模型输入部署WebUI服务的models文件路径地址。
> **提示**: 您可以通过在文本框中输入多个本地模型路径来上传多种模型。
4. 点击**Upload Models to Cloud**,启动模型上传。
5. 上传完成后,会在左侧**Label**看到提示。
### 从本地机器上传模型至云上
考虑到用户多样的使用场景本方式适用于将webUI前端部署在本地电脑上的场景。
1. 进入解决方案主标签页**Amazon SageMaker**,找到**Cloud Models Management**模块。
2. 选择from My Computer标签页, 该方式表示从访问WebUI的本地路径上传模型。
![Upload Models to S3](../images/UploadFromComputer.png)
3. 选择要上传的模型类型目前支持六种SD Checkpoints, Textual Inversion, LoRA model, ControlNet model, Hypernetwork, VAE
4. 本地选择要上传的模型文件。
> **提示**: 您可以多选模型文件但受制于浏览器限制最好选择的文件数不要超过10个总大小不要超过8g。
5. 点击**Upload Models to Cloud**,启动模型上传。
6. 上传会依据文件大小与数量异步分片上传,各分片上传完成后,会在**选择文件**按钮下看到提示。
### 从模型下载地址直接上传至云上
考虑到用户多样的使用场景本方式适用于直接通过模型下载的URL地址上传到S3的场景。
1. 进入解决方案主标签页**Amazon SageMaker**,找到**Cloud Models Management**模块。
2. 选择from URL标签页, 该方式表示从模型下载的URL地址上传到S3。
![Upload Models to S3](../images/UploadFromURL.png)
3. 选择要上传的模型类型目前支持六种SD Checkpoints, Textual Inversion, LoRA model, ControlNet model, Hypernetwork, VAE
4. 在URL list (Comma-separated in English)输入框中填入模型下载的url列表用英文逗号分隔。
5. 在Models Description (Optional)输入框中输入json格式的描述选填
> **提示**: 您可以多选模型文件但受制于Lambda内存以及并发线程数的限制最好选择的文件数不要超过5个总大小不要超过12g。
6. 点击**Upload Models to Cloud**,启动模型上传。
7. 上传请求会在下方**Label**看到提示。
## Amazon SageMaker推理节点管理
### 部署推理节点
1. 进入解决方案主标签页**Amazon SageMaker**,找到**Cloud Assents Management**模块的**Deploy New SageMaker Endpoint**区域。
2. 方案默认部署的Endpoint类型为ml.g5.2xlarge, instance数量是1默认会开启endpoint的autoscaling功能直接点击**Deploy**按钮启动Sagemaker endpoint的部署。
3. 如果用户需要自己指定Endpoint的名字Instance类型以及Endpoint中instance的最大数量可以点击**Advanced Endpoint Configuration**的checkbox这时界面会显示更多的参数让用户输入下表展示相关参数的名字和含义:
| 参数名 | 描述 |
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| Endpoint Name (可选) | 如果需要指定Sagemaker endpoint的名字在这个输入框中输入如果不修改这个值默认的Endpoint的名字为 esd-type-XXXXX |
| Endpoint Type | 下拉框选择部署的Endpoint的推理类型 Async / Real-time |
| Instance Type | 下拉框选择部署的Endpoint的实例类型 |
| Max Instance Number | 下拉框选择部署的Endpoint的实例最大值如果选择了Autoscaling异步推理会根据平均每个实例队列积压情况在 0-Max Instance Number 之间弹性伸缩,同步推理会根据平均每个实例调用数在 1-Max Instance Number 之间弹性伸缩 |
| Enable Autoscaling | 如果选择了该checkboxSagemaker会根据CPU的平均占用率在 0-Max Instance Number 之间弹性伸缩, 否则Endpoint对应的instance数会固定在 Max Instance Number |
| Min Instance Number | 如果选择了 Enable Autoscaling该值将是 Endpoint 实例数的最小数量 |
4. 选择完默认的Endpoint配置或者设置完高级的Endpoint配置后点击**Deploy**, 可以在**Label**处看到**Endpoint deployment started**的提示信息。
![Deploy new endpoint](../images/Deploy-new-endpoint.png)
5. 您可进入**Amazon SageMaker**的**Inference Endpoint Management**模块,刷新并看到当前所有推理节点的部署状态。
> **补充:** 推理节点列表的名字的格式是:推理节点名字+部署状态Creating/Failed/InService+部署结束时间。
6. 等待大约3分钟即可看到最新推理节点的状态变成**InService**,表明推理节点部署成功。
### 删除已部署推理节点
1. 进入解决方案主标签页**Amazon SageMaker**,点击**Inference Endpoint Management**列表右侧刷新按钮,刷新下拉列表,选择需要删除的推理节点。
2. 点击**Delete**,左侧**Label**处会显示提示信息,完成推理节点删除。
## AWS数据集管理
### 数据集上传
在模型微调等功能中,需要输入一个图片集,用以微调工作。该功能模块助力用户快速上传图片集到云端。
1. 进入解决方案主标签页**Amazon SageMaker****AWS Dataset Management**区块,**Create**标签页。
![Create Dataset to S3](../images/Dataset_management.png)
2. 点击**Click to Upload a File**,在弹出的本地文件列表中,确认选中一次模型微调所需的所有图片。
3. 在**Dataset Name**输入该图片文件夹的名字,在**Dataset Description**输入该数据集的描述,点击**Create Dataset**。
4. 等待几秒,下方的**Create Result**区域显示**Complete Dataset XXXX creation**,即表示该数据集已经成功上传到云上。
### 数据集浏览
数据集上传完成后,通过此功能模块,能够帮助用户快速得到数据集对应的云上地址。用户可以复制此地址,粘贴到对应需要上传图片集的地址位置。
1. 进入解决方案主标签页**Amazon SageMaker****AWS Dataset Management**区块,**Browse**标签页。
2. 刷新**Dataset From Cloud**列表,选择需要浏览的图片集名称。
3. 等待几秒,**dataset s3 location**区域即会显示该数据集的云上S3地址复制粘贴即可取用做后续步骤。

View File

@ -2,15 +2,16 @@
在成功部署解决方案后,您可以打开部署成功的堆栈所提供的**ComfyUI**原生页面,在工作流的调试、发布和推理,总结步骤如下:
1. 在本地虚拟机EC2上进行新工作流的调试安装缺失的节点并上传所需的推理模型并能够成功在本地虚拟机EC2加载并推理成功。
2. 在发布该工作流为模版。
3. 创建工作流所需endpoint
4. 在ComfyUI推理页面选择已发布模版按需修改推理词、推理模型并推理图片/视频。
* 步骤1: 连接部署了ComfyUI前端的EC2。
* 步骤2: 在本方案提供的**Designer**链接页面可进行新工作流的调试安装缺失的节点并上传所需的推理模型并能够成功在本地虚拟机EC2加载并推理成功。
* 步骤3: 在发布该工作流为模版。
* 步骤4: 创建工作流所需endpoint通过API方式创建
* 步骤5: 在ComfyUI推理页面选择已发布模版按需修改推理词、推理模型并推理图片/视频。本步骤将会使用Amazon SageMaker资源。
## 连接部署ComfyUI的虚拟机EC2
推荐使用VS Code通过连接远程EC2的方式在本地打开EC2对应的目录结构能更方便的看到本地工作流调试时的日志文件帮助判断。
## 步骤1: 连接部署ComfyUI前端的虚拟机EC2
通过连接EC2的方式在本地打开EC2对应的目录结构能更方便的看到本地工作流调试时的日志文件帮助判断。
如仅需看到本地ComfyUI调试的日志也可通过以下步骤实现
@ -26,18 +27,12 @@ sudo journalctl -u comfy --no-pager -n 200 用于查看comfy运行日志最后20
docker images -q | xargs docker rmi -f
```
## 工作流管理
主要包括以下过程:
## 步骤2: 调试工作流
打开本方案部署后,提供的**Designer**链接,即为工作流调试员/主美视角的**ComfyUI**您可以按单机版ComfyUI的使用方法来进行新的工作流的调试。有关模型的管理、定制节点的管理等可以通过连接部署ComfyUI的虚拟机EC2来进行。
- 步骤1工作流的调试。
- 步骤2工作流的发布。
- 步骤3创建工作流的推理端点。
- 步骤4基于已发布工作流的推理。
![major-designer](../../images/senior-design.png)
### 工作流的调试
在本解决方案提供的**ComfyUI**原生界面中您可以按单机版ComfyUI的使用方法来进行新的工作流的调试。有关模型的管理、定制节点的管理等可以通过连接部署ComfyUI的虚拟机EC2来进行。
单机版的ComfyUI使用步骤总结如下
主美调试的ComfyUI使用步骤总结如下
1. 可选拖拽已有工作流的json文件到ComfyUI界面得到渲染出来的工作流。
2. 调整包括添加和删除工作节点custom node并调整推理参数及使用的模型。
@ -48,7 +43,7 @@ docker images -q | xargs docker rmi -f
5. 当工作流完成后,看到界面显示出生成结果,即表示该工作流的调试工作已经成功。
### 工作流的发布
## 步骤3: 发布工作流为新模版
待工作流在本地虚拟机EC2已经可以成功推理图片/视频后,可以快速跟随以下步骤,将调试好的工作流发布成为模版,便于后续稳定、便利的调用推理。
1. 点击右侧导航栏中的**New Workflow** 或 右侧导航工作流列表模块上方加号。
@ -60,18 +55,19 @@ docker images -q | xargs docker rmi -f
3. 工作流发布过程中ComfyUI前端不可以有更新操作。在发布完成后会在前端有弹框提示发布完成。
4. 发布时会将您页面当前调试时的workflow暂存每次切换环境时会优先加载当前环境对应暂存的workflow。
### 创建工作流的推理端点
## 步骤4: 创建工作流在云上推理的推理端点
待工作流发布完成以后,还需要创建推理端点来依据工作流进行云端推理。
1. 需要通过api的方式调用创建可以参考[这里](../../deployment/deployment_comfyui.md)中的“部署新的Amazon SageMaker推理节点”子章节部分。
2. 待推理端点创建完成后且为InService的状态后已发布的工作流便处于可推理的状态。
### 基于已发布工作流的推理
## 步骤5: 基于已发布工作流的推理
在ComfyUI的推理页面可以简单通过以下步骤完成基于模版的推理。
1. 打开ComfyUI的推理页面在右侧导航栏选择一个已发布的模版。如果是调试环境还需要选中右侧导航栏中“Prompt on AWS”复选框。
2. ComfyUI页面即会自动渲染该模版的工作流按需调整参数并点击**添加提示词队列Queue Prompt**,提交推理任务。
3. 当推理任务完成后,生成结果会自动展示在页面。
## 模型管理
### 模型上传
新模型需要上传到EC2才能保证在模型调试阶段能够顺利调取。在EC2中上传模型可以通过进入models目录下对应的模型类别子文件夹通过直接拖拽或者wget + 模型下载地址的方式来实现。考虑到网速推荐优先使用wget模型下载方式。

View File

@ -1,13 +0,0 @@
## 连接Stable Diffusion WebUI与AWS账号
## 要求
您需要部署好解决方案。
## 步骤
1. 访问[AWS CloudFormation控制台](https://console.aws.amazon.com/cloudformation/)。
2. 从堆栈列表中选择方案的堆栈。
3. 打开输出Outputs标签页找到**APIGatewayUrl**对应的URL并复制。
4. 打开Stable Diffusion WebUI中的**Amazon SageMaker**标签页,在**API URL**文本框粘贴步骤3得到的URL。在**API Token**输入 token设置用户名和密码。
5. 点击**Test Connection & Update Setting** 。