Skip to content

Commit 83054fb

Browse files
authored
Merge pull request #43 from aws-solutions-library-samples/sd-model-replacement
Upgrade default SD model to SDXL-Turbo
2 parents 7fec0ba + 20af8f2 commit 83054fb

File tree

10 files changed

+35
-39
lines changed

10 files changed

+35
-39
lines changed

deploy/config.yaml.template

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ APIGW:
1111
modelsRuntime:
1212
- name: ${RUNTIME_NAME}
1313
namespace: "default"
14-
modelFilename: "v1-5-pruned-emaonly.safetensors"
14+
modelFilename: "sd_xl_turbo_1.0.safetensors"
1515
dynamicModel: false
1616
type: ${RUNTIME_TYPE}
1717
extraValues:
@@ -23,11 +23,7 @@ modelsRuntime:
2323
provisioner:
2424
instanceType:
2525
- "g6.2xlarge"
26-
- "g6.xlarge"
27-
- "g5.xlarge"
28-
- "g4dn.xlarge"
2926
- "g5.2xlarge"
30-
- "g4dn.2xlarge"
3127
capacityType:
3228
onDemand: true
3329
spot: true

deploy/install-tools.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ kubectl_version='1.29.0'
66
helm_version='3.10.1'
77
yq_version='4.30.4'
88
s5cmd_version='2.2.2'
9-
node_version='20.13.1'
10-
cdk_version='2.133.0'
9+
node_version='22.12.0'
10+
cdk_version='2.162.1'
1111

1212
download () {
1313
url=$1

deploy/upload-model.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ MODEL_BUCKET="$1"
66

77
AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-$(aws ec2 describe-availability-zones --output text --query 'AvailabilityZones[0].[RegionName]')}
88

9-
MODEL_URL="https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors?download=true"
10-
MODEL_NAME="v1-5-pruned-emaonly.safetensors"
9+
MODEL_URL="https://huggingface.co/stabilityai/sdxl-turbo/resolve/main/sd_xl_turbo_1.0.safetensors"
10+
MODEL_NAME="sd_xl_turbo_1.0.safetensors"
1111

12-
printf "Transport SD 1.5 base model from hugging face to S3 bucket...\n"
12+
printf "Transport SDXL-Turbo model from hugging face to S3 bucket...\n"
1313
curl -L "$MODEL_URL" | aws s3 cp - s3://${MODEL_BUCKET}/Stable-diffusion/${MODEL_NAME}
1414

1515
printf "Model uploaded to s3://${MODEL_BUCKET}/Stable-diffusion/${MODEL_NAME}\n"

docs/api/v1alpha1.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ paths:
3939
sd_model_checkpoint:
4040
type: string
4141
description: Selected model
42-
example: "v1-5-pruned-emaonly.safetensors"
42+
example: "sd_xl_turbo_1.0.safetensors"
4343
output_location:
4444
type: string
4545
description: Location of output file
@@ -72,11 +72,11 @@ components:
7272
type: string
7373
sd_model_checkpoint:
7474
description: Checkpoint used in the task
75-
example: "v1-5-pruned-emaonly.safetensors"
75+
example: "sd_xl_turbo_1.0.safetensors"
7676
type: string
7777
id_task:
7878
description: Task ID
79-
example: "v1-5-pruned-emaonly.safetensors"
79+
example: "sd_xl_turbo_1.0.safetensors"
8080
type: string
8181
uid:
8282
type: string

docs/en/async_img_sd_IG.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ cd deploy
328328
This script will:
329329

330330
* Install the necessary runtimes and tools.
331-
* Create an S3 bucket, download the Stable Diffusion 1.5 foundation model from [HuggingFace](https://huggingface.co/runwayml/stable-diffusion-v1-5){:target="_blank"}, and place it in the bucket.
331+
* Create an S3 bucket, download the Stable Diffusion XL-Turbo foundation model from [HuggingFace](https://huggingface.co/stabilityai/sdxl-turbo){:target="_blank"}, and place it in the bucket.
332332
* Create an EBS snapshot containing the SD Web UI image using our provided sample image.
333333
* Create a Stable Diffusion guidance with the SD Web UI runtime.
334334

@@ -679,7 +679,7 @@ The configuration for This guidance is stored in the `config.yaml` file. We prov
679679
- name: "sdruntime" # Required parameter, the name of the runtime, cannot be the same as other runtimes
680680
namespace: "default" # Required parameter, the Kubernetes namespace where the runtime is located, not recommended to place in the same namespace as other runtimes
681681
type: "sdwebui" # Required parameter, the type of this runtime, currently only supports "sdwebui" and "comfyui"
682-
modelFilename: "v1-5-pruned-emaonly.safetensors" # (SD Web UI) Name of the model used by this runtime, cannot be the same as other runtimes
682+
modelFilename: "sd_xl_turbo_1.0.safetensors" # (SD Web UI) Name of the model used by this runtime, cannot be the same as other runtimes
683683
dynamicModel: false # (SD Web UI) Whether this runtime allows dynamic model loading
684684
```
685685
@@ -694,7 +694,7 @@ The configuration for This guidance is stored in the `config.yaml` file. We prov
694694
- name: "sdruntime"
695695
namespace: "default"
696696
type: "sdwebui"
697-
modelFilename: "v1-5-pruned-emaonly.safetensors"
697+
modelFilename: "sd_xl_turbo_1.0.safetensors"
698698
dynamicModel: false
699699
chartRepository: "" # Optional parameter, if you built the Helm Chart, enter the address where the Chart is located. Include the protocol prefix (oci:// or https://)
700700
chartVersion: "" # Optional parameter, if you built the Helm Chart, enter the version of the Chart
@@ -719,7 +719,7 @@ The configuration for This guidance is stored in the `config.yaml` file. We prov
719719
- name: "sdruntime"
720720
namespace: "default"
721721
type: "sdwebui"
722-
modelFilename: "v1-5-pruned-emaonly.safetensors"
722+
modelFilename: "sd_xl_turbo_1.0.safetensors"
723723
extraValues:
724724
karpenter: # Add the following content
725725
nodeTemplate:
@@ -840,7 +840,7 @@ APIGW:
840840
modelsRuntime:
841841
- name: sdruntime
842842
namespace: "default"
843-
modelFilename: "v1-5-pruned-emaonly.safetensors"
843+
modelFilename: "sd_xl_turbo_1.0.safetensors"
844844
dynamicModel: false
845845
# chartRepository: "http://example.com/" # If you self-hosted the Helm Chart, uncomment this line and change the value to the address of the Helm Chart (oci:// or http://), otherwise delete this line
846846
type: sdwebui
@@ -1073,7 +1073,7 @@ v1alpha1
10731073
{
10741074
"alwayson_scripts": {
10751075
"task": "text-to-image", // Required, task type
1076-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors", // Required, base model name
1076+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors", // Required, base model name
10771077
"id_task": "test-t2i", // Required, task ID, used when uploading result images and returning responses
10781078
"save_dir": "outputs" // Required, the prefix (directory name) for the output file in the S3 bucket
10791079
},
@@ -1104,7 +1104,7 @@ v1alpha1
11041104
```json-doc
11051105
{
11061106
"id_task": "test-t2i",
1107-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors",
1107+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors",
11081108
"output_location": "s3://outputbucket/output/test-t2i"
11091109
}
11101110
```
@@ -1116,7 +1116,7 @@ If the corresponding runtime is set to `dynamicModel: true`, you need to add the
11161116
```json-doc
11171117
"content": {
11181118
"alwayson_scripts": {
1119-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors" //Place the model name here
1119+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors" //Place the model name here
11201120
},
11211121
}
11221122
```
@@ -1174,7 +1174,7 @@ v1alpha1
11741174
"task": "image-to-image", // Required, task type
11751175
"image_link": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png", // Required, URL of the input image
11761176
"id_task": "test-i2i", // Required, task ID, used when uploading result images and returning responses
1177-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors", // Required, base model name, associated with queue dispatching or model switching
1177+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors", // Required, base model name, associated with queue dispatching or model switching
11781178
},
11791179
// The following are official parameters, use the default values or pass them in directly
11801180
"prompt": "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k",
@@ -1203,7 +1203,7 @@ v1alpha1
12031203
```json-doc
12041204
{
12051205
"id_task": "test-i2i",
1206-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors",
1206+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors",
12071207
"output_location": "s3://outputbucket/output/test-t2i"
12081208
}
12091209
```
@@ -1215,7 +1215,7 @@ If the corresponding runtime is set to `dynamicModel: true`, you need to add the
12151215
```json-doc
12161216
"content": {
12171217
"alwayson_scripts": {
1218-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors" //Place the model name here
1218+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors" //Place the model name here
12191219
},
12201220
}
12211221
```

docs/zh/async_img_sd_zh_IG.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ cd deploy
311311
该脚本将:
312312

313313
* 安装必要的运行时和工具
314-
* 创建S3存储桶,从[HuggingFace](https://huggingface.co/runwayml/stable-diffusion-v1-5){:target="_blank"} 中下载Stable Diffusion 1.5的基础模型,放置在存储桶中
314+
* 创建S3存储桶,从[HuggingFace](https://huggingface.co/stabilityai/sdxl-turbo){:target="_blank"} 中下载Stable Diffusion XL-Turbo的基础模型,放置在存储桶中
315315
* 使用我们提供的示例镜像,创建包含SD Web UI镜像的EBS快照
316316
* 创建一个含SD Web UI运行时的Stable Diffusion解决方案
317317

@@ -663,7 +663,7 @@ cd utils/bottlerocket-images-cache
663663
- name: "sdruntime" # 必要参数,运行时的名称,不能和其他运行时重名
664664
namespace: "default" # 必要参数,运行时所在的Kubernetes命名空间,不建议和其他运行时放置在相同的命名空间。
665665
type: "sdwebui" # 必要参数,该运行时的类型,目前仅支持"sdwebui"和"comfyui"
666-
modelFilename: "v1-5-pruned-emaonly.safetensors" # (SD Web UI)该运行时使用的模型名称,不能和其他运行时重复。
666+
modelFilename: "sd_xl_turbo_1.0.safetensors" # (SD Web UI)该运行时使用的模型名称,不能和其他运行时重复。
667667
dynamicModel: false # (SD Web UI)该运行时是否允许动态加载模型。
668668
```
669669
@@ -678,7 +678,7 @@ cd utils/bottlerocket-images-cache
678678
- name: "sdruntime"
679679
namespace: "default"
680680
type: "sdwebui"
681-
modelFilename: "v1-5-pruned-emaonly.safetensors"
681+
modelFilename: "sd_xl_turbo_1.0.safetensors"
682682
dynamicModel: false
683683
chartRepository: "" # 可选参数,如您构建了Helm Chart,则需要填入Chart所在的地址。需要包含协议前缀 (oci:// 或 https:// )
684684
chartVersion: "" # 可选参数,如您构建了Helm Chart,则需要填入Chart的版本
@@ -703,7 +703,7 @@ cd utils/bottlerocket-images-cache
703703
- name: "sdruntime"
704704
namespace: "default"
705705
type: "sdwebui"
706-
modelFilename: "v1-5-pruned-emaonly.safetensors"
706+
modelFilename: "sd_xl_turbo_1.0.safetensors"
707707
extraValues:
708708
karpenter: # 添加以下内容
709709
nodeTemplate:
@@ -825,7 +825,7 @@ APIGW:
825825
modelsRuntime:
826826
- name: sdruntime
827827
namespace: "default"
828-
modelFilename: "v1-5-pruned-emaonly.safetensors"
828+
modelFilename: "sd_xl_turbo_1.0.safetensors"
829829
dynamicModel: false
830830
# chartRepository: "http://example.com/" # 如您自行托管Helm Chart,请去除此行注释,并将值改为Helm Chart的地址(oci://或http://),否则删除此行。
831831
type: sdwebui
@@ -1061,7 +1061,7 @@ v1alpha1
10611061
{
10621062
"alwayson_scripts": {
10631063
"task": "text-to-image", // 必要,任务类型
1064-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors", // 必要,基础模型名称,关联队列分发或模型切换
1064+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors", // 必要,基础模型名称,关联队列分发或模型切换
10651065
"id_task": "test-t2i", // 必要,任务ID,在上传结果图片和返回响应时会用到
10661066
"save_dir": "outputs" // 必要,输出文件在S3桶中的前缀(即目录名)
10671067
},
@@ -1092,7 +1092,7 @@ v1alpha1
10921092
```json-doc
10931093
{
10941094
"id_task": "test-t2i",
1095-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors",
1095+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors",
10961096
"output_location": "s3://outputbucket/output/test-t2i"
10971097
}
10981098
```
@@ -1104,7 +1104,7 @@ v1alpha1
11041104
```json-doc
11051105
"content": {
11061106
"alwayson_scripts": {
1107-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors" //此处放入模型名称
1107+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors" //此处放入模型名称
11081108
},
11091109
}
11101110
```
@@ -1163,7 +1163,7 @@ v1alpha1
11631163
"task": "image-to-image", // 必要,任务类型
11641164
"image_link": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png", // 必要,输入图片的url
11651165
"id_task": "test-i2i", // 必要,任务ID,在上传结果图片和返回响应时会用到
1166-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors", // 必要,基础模型名称,关联队列分发或模型切换
1166+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors", // 必要,基础模型名称,关联队列分发或模型切换
11671167
},
11681168
// 以下皆为官方参数,使用默认值或者直接传入即可
11691169
"prompt": "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k",
@@ -1192,7 +1192,7 @@ v1alpha1
11921192
```json-doc
11931193
{
11941194
"id_task": "test-i2i",
1195-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors",
1195+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors",
11961196
"output_location": "s3://outputbucket/output/test-t2i"
11971197
}
11981198
```
@@ -1204,7 +1204,7 @@ v1alpha1
12041204
```json-doc
12051205
"content": {
12061206
"alwayson_scripts": {
1207-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors" //此处放入模型名称
1207+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors" //此处放入模型名称
12081208
},
12091209
}
12101210
```

test/v1alpha1/i2i.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"task": "image-to-image",
44
"image_link": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png",
55
"id_task": "test-i2i",
6-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors",
6+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors",
77
"save_dir": "outputs"
88
},
99
"prompt": "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k",

test/v1alpha1/t2i.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"alwayson_scripts": {
33
"task": "text-to-image",
4-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors",
4+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors",
55
"id_task": "test-t2i",
66
"save_dir": "outputs"
77
},

test/v1alpha1/t2v.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"alwayson_scripts": {
33
"task": "text-to-image",
4-
"sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors",
4+
"sd_model_checkpoint": "sd_xl_turbo_1.0.safetensors",
55
"id_task": "gif1",
66
"uid": "gif1",
77
"save_dir": "outputs",

test/v1alpha2/pipeline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"4": {
4242
"inputs": {
43-
"ckpt_name": "v1-5-pruned-emaonly.safetensors"
43+
"ckpt_name": "sd_xl_turbo_1.0.safetensors"
4444
},
4545
"class_type": "CheckpointLoaderSimple",
4646
"_meta": {

0 commit comments

Comments
 (0)