Skip to content

Commit 98d18e4

Browse files
Nupur KumariNupur Kumari
authored andcommitted
diffusers==0.14.0 update
1 parent aadbb27 commit 98d18e4

File tree

4 files changed

+36
-16
lines changed

4 files changed

+36
-16
lines changed

MIT_License.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Custom Diffusion
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

src/diffusers_model_pipeline.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
# http://www.apache.org/licenses/
77
# ==========================================================================================
88
#
9-
# Adobe’s modifications are Copyright 2022 Adobe Research. All rights reserved.
10-
# Adobe’s modifications are licensed under the Adobe Research License. To view a copy of the license, visit
11-
# LICENSE.md.
9+
# modifications are MIT License. To view a copy of the license, visit MIT_LICENSE.md.
1210
#
1311
# ==========================================================================================
1412
# Apache License
@@ -299,10 +297,10 @@ def __call__(
299297
key = attn.to_k(encoder_hidden_states)
300298
value = attn.to_v(encoder_hidden_states)
301299
if crossattn:
302-
modifier = torch.ones_like(key)
303-
modifier[:, :1, :] = modifier[:, :1, :]*0.
304-
key = modifier*key + (1-modifier)*key.detach()
305-
value = modifier*value + (1-modifier)*value.detach()
300+
detach = torch.ones_like(key)
301+
detach[:, :1, :] = detach[:, :1, :]*0.
302+
key = detach*key + (1-detach)*key.detach()
303+
value = detach*value + (1-detach)*value.detach()
306304

307305
query = attn.head_to_batch_dim(query)
308306
key = attn.head_to_batch_dim(key)
@@ -342,10 +340,10 @@ def __call__(self, attn: CrossAttention, hidden_states, encoder_hidden_states=No
342340
key = attn.to_k(encoder_hidden_states)
343341
value = attn.to_v(encoder_hidden_states)
344342
if crossattn:
345-
modifier = torch.ones_like(key)
346-
modifier[:, :1, :] = modifier[:, :1, :]*0.
347-
key = modifier*key + (1-modifier)*key.detach()
348-
value = modifier*value + (1-modifier)*value.detach()
343+
detach = torch.ones_like(key)
344+
detach[:, :1, :] = detach[:, :1, :]*0.
345+
key = detach*key + (1-detach)*key.detach()
346+
value = detach*value + (1-detach)*value.detach()
349347

350348
query = attn.head_to_batch_dim(query).contiguous()
351349
key = attn.head_to_batch_dim(key).contiguous()

src/diffusers_sample.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
# Copyright 2022 Adobe Research. All rights reserved.
2-
# To view a copy of the license, visit LICENSE.md.
1+
# ==========================================================================================
2+
#
3+
# MIT License. To view a copy of the license, visit MIT_LICENSE.md.
4+
#
5+
# ==========================================================================================
36

47
import argparse
58
import sys

src/diffusers_training.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
# http://www.apache.org/licenses/
77
# ==========================================================================================
88
#
9-
# Adobe’s modifications are Copyright 2022 Adobe Research. All rights reserved.
10-
# Adobe’s modifications are licensed under the Adobe Research License. To view a copy of the license, visit
11-
# LICENSE.md.
9+
# modifications are MIT License. To view a copy of the license, visit MIT_LICENSE.md.
1210
#
1311
# ==========================================================================================
1412
# Apache License

0 commit comments

Comments
 (0)