Skip to content

Commit efd6cff

Browse files
authored
Merge pull request PaddlePaddle#51 from JunnYu/ppdiffusers_v0.16.3
[PPDiffusers] Release PPDiffusers v0.16.3
2 parents 6a75d16 + 7063363 commit efd6cff

24 files changed

Lines changed: 724 additions & 23 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ __pycache__/
1111
*.so
1212

1313
# json file
14-
*.json
14+
# *.json
1515

1616
# log file
1717
*.log

ppdiffusers/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.16.1
1+
0.16.3

ppdiffusers/deploy/controlnet/infer_dygraph.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ def main(args):
198198
continue
199199
else:
200200
raise ValueError(e)
201+
202+
if not args.use_fp16 and attention_type == "flash":
203+
print(
204+
"Flash attention is not supported dtype=float32! Please use float16 or bfloat16. We will skip this!"
205+
)
206+
continue
201207
guess_mode = args.guess_mode
202208
width = args.width
203209
height = args.height

ppdiffusers/deploy/controlnet/infer_dygraph_toch.py renamed to ppdiffusers/deploy/controlnet/infer_dygraph_torch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ def parse_arguments():
126126
"--pretrained_model_name_or_path",
127127
type=str,
128128
default="runwayml/stable-diffusion-v1-5",
129-
help="Path to the `ppdiffusers` checkpoint to convert (either a local directory or on the bos).",
129+
help="Path to the `diffusers` checkpoint to convert (either a local directory or on the bos).",
130130
)
131131
parser.add_argument(
132132
"--controlnet_pretrained_model_name_or_path",
133133
type=str,
134134
default="lllyasviel/sd-controlnet-canny",
135-
help="Path to the `ppdiffusers` controlnet_pretrained_model_name_or_path checkpoint to convert (either a local directory or on the bos).",
135+
help="Path to the `diffusers` controlnet_pretrained_model_name_or_path checkpoint to convert (either a local directory or on the bos).",
136136
)
137137
parser.add_argument(
138138
"--inference_steps",

ppdiffusers/deploy/infer_dygraph.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ def main(args):
161161
else:
162162
raise ValueError(e)
163163

164+
if not args.use_fp16 and attention_type == "flash":
165+
print(
166+
"Flash attention is not supported dtype=float32! Please use float16 or bfloat16. We will skip this!"
167+
)
168+
continue
164169
width = args.width
165170
height = args.height
166171
hr_resize_width = args.hr_resize_width
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ppdiffusers>=0.16.1
1+
ppdiffusers>=0.16.3

ppdiffusers/deploy/scripts/test_controlnet_infer_dygraph_torch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
cd ../controlnet
1515
pip install diffusers==0.17.1
1616

17-
python infer_dygraph_toch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
17+
python infer_dygraph_torch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
1818
--controlnet_pretrained_model_name_or_path lllyasviel/sd-controlnet-canny \
1919
--task_name all --use_fp16 True \
2020
--attention_type raw --benchmark_steps 10 --device_id 0 --parse_prompt_type raw
2121

22-
python infer_dygraph_toch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
22+
python infer_dygraph_torch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
2323
--controlnet_pretrained_model_name_or_path lllyasviel/sd-controlnet-canny \
2424
--task_name all --use_fp16 True \
2525
--attention_type sdp --benchmark_steps 10 --device_id 0 --parse_prompt_type raw
2626

27-
python infer_dygraph_toch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
27+
python infer_dygraph_torch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
2828
--controlnet_pretrained_model_name_or_path lllyasviel/sd-controlnet-canny \
2929
--task_name all --use_fp16 True \
3030
--attention_type sdp --benchmark_steps 10 --device_id 0 --parse_prompt_type raw --compile True --channels_last True

ppdiffusers/deploy/scripts/test_infer_dygraph_torch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
cd ..
1515
pip install diffusers==0.17.1
1616

17-
python infer_dygraph_toch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
17+
python infer_dygraph_torch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
1818
--task_name all --use_fp16 True \
1919
--attention_type raw --benchmark_steps 10 --device_id 0 --parse_prompt_type raw
2020

21-
python infer_dygraph_toch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
21+
python infer_dygraph_torch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
2222
--task_name all --use_fp16 True \
2323
--attention_type sdp --benchmark_steps 10 --device_id 0 --parse_prompt_type raw
2424

25-
python infer_dygraph_toch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
25+
python infer_dygraph_torch.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 \
2626
--task_name all --use_fp16 True \
2727
--attention_type sdp --benchmark_steps 10 --device_id 0 --parse_prompt_type raw --compile True --channels_last True
2828

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"act_fn": "silu",
3+
"block_out_channels": [
4+
128,
5+
256,
6+
512,
7+
512
8+
],
9+
"down_block_out_channels": null,
10+
"down_block_types": [
11+
"DownEncoderBlock2D",
12+
"DownEncoderBlock2D",
13+
"DownEncoderBlock2D",
14+
"DownEncoderBlock2D"
15+
],
16+
"in_channels": 3,
17+
"layers_per_block": 2,
18+
"norm_num_groups": 32,
19+
"out_channels": 3,
20+
"sample_size": 512,
21+
"up_block_out_channels": [
22+
128,
23+
256,
24+
256,
25+
256,
26+
512
27+
],
28+
"latent_channels": 4,
29+
"up_block_types": [
30+
"UpDecoderBlock2D",
31+
"UpDecoderBlock2D",
32+
"UpDecoderBlock2D",
33+
"UpDecoderBlock2D",
34+
"UpDecoderBlock2D"
35+
]
36+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"_class_name": "Adapter",
3+
"_ppdiffusers_version": "0.2.2",
4+
"channels_in": 3,
5+
"block_out_channels": [
6+
320,
7+
640,
8+
1280,
9+
1280
10+
],
11+
"num_res_blocks": 2,
12+
"kernel_size": 1,
13+
"res_block_skip": true,
14+
"use_conv": false,
15+
"input_scale_factor": 8
16+
}

0 commit comments

Comments
 (0)