Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
diffusers
Commits
e6a84922
Unverified
Commit
e6a84922
authored
Mar 18, 2024
by
M. Tolga Cangöz
Committed by
GitHub
Mar 18, 2024
Browse files
Use PyTorch's conventional inplace functions (#7332)
Co-authored-by:
Sayak Paul
<
spsayakpaul@gmail.com
>
parent
ad0308b3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
tests/pipelines/controlnet/test_controlnet.py
tests/pipelines/controlnet/test_controlnet.py
+2
-2
tests/pipelines/controlnet/test_controlnet_img2img.py
tests/pipelines/controlnet/test_controlnet_img2img.py
+1
-1
tests/pipelines/controlnet/test_controlnet_inpaint.py
tests/pipelines/controlnet/test_controlnet_inpaint.py
+1
-1
tests/pipelines/controlnet/test_controlnet_sdxl.py
tests/pipelines/controlnet/test_controlnet_sdxl.py
+2
-2
No files found.
tests/pipelines/controlnet/test_controlnet.py
View file @
e6a84922
...
@@ -302,7 +302,7 @@ class StableDiffusionMultiControlNetPipelineFastTests(
...
@@ -302,7 +302,7 @@ class StableDiffusionMultiControlNetPipelineFastTests(
def
init_weights
(
m
):
def
init_weights
(
m
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
torch
.
nn
.
init
.
normal
(
m
.
weight
)
torch
.
nn
.
init
.
normal
_
(
m
.
weight
)
m
.
bias
.
data
.
fill_
(
1.0
)
m
.
bias
.
data
.
fill_
(
1.0
)
controlnet1
=
ControlNetModel
(
controlnet1
=
ControlNetModel
(
...
@@ -519,7 +519,7 @@ class StableDiffusionMultiControlNetOneModelPipelineFastTests(
...
@@ -519,7 +519,7 @@ class StableDiffusionMultiControlNetOneModelPipelineFastTests(
def
init_weights
(
m
):
def
init_weights
(
m
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
torch
.
nn
.
init
.
normal
(
m
.
weight
)
torch
.
nn
.
init
.
normal
_
(
m
.
weight
)
m
.
bias
.
data
.
fill_
(
1.0
)
m
.
bias
.
data
.
fill_
(
1.0
)
controlnet
=
ControlNetModel
(
controlnet
=
ControlNetModel
(
...
...
tests/pipelines/controlnet/test_controlnet_img2img.py
View file @
e6a84922
...
@@ -210,7 +210,7 @@ class StableDiffusionMultiControlNetPipelineFastTests(
...
@@ -210,7 +210,7 @@ class StableDiffusionMultiControlNetPipelineFastTests(
def
init_weights
(
m
):
def
init_weights
(
m
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
torch
.
nn
.
init
.
normal
(
m
.
weight
)
torch
.
nn
.
init
.
normal
_
(
m
.
weight
)
m
.
bias
.
data
.
fill_
(
1.0
)
m
.
bias
.
data
.
fill_
(
1.0
)
controlnet1
=
ControlNetModel
(
controlnet1
=
ControlNetModel
(
...
...
tests/pipelines/controlnet/test_controlnet_inpaint.py
View file @
e6a84922
...
@@ -273,7 +273,7 @@ class MultiControlNetInpaintPipelineFastTests(
...
@@ -273,7 +273,7 @@ class MultiControlNetInpaintPipelineFastTests(
def
init_weights
(
m
):
def
init_weights
(
m
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
torch
.
nn
.
init
.
normal
(
m
.
weight
)
torch
.
nn
.
init
.
normal
_
(
m
.
weight
)
m
.
bias
.
data
.
fill_
(
1.0
)
m
.
bias
.
data
.
fill_
(
1.0
)
controlnet1
=
ControlNetModel
(
controlnet1
=
ControlNetModel
(
...
...
tests/pipelines/controlnet/test_controlnet_sdxl.py
View file @
e6a84922
...
@@ -503,7 +503,7 @@ class StableDiffusionXLMultiControlNetPipelineFastTests(
...
@@ -503,7 +503,7 @@ class StableDiffusionXLMultiControlNetPipelineFastTests(
def
init_weights
(
m
):
def
init_weights
(
m
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
torch
.
nn
.
init
.
normal
(
m
.
weight
)
torch
.
nn
.
init
.
normal
_
(
m
.
weight
)
m
.
bias
.
data
.
fill_
(
1.0
)
m
.
bias
.
data
.
fill_
(
1.0
)
controlnet1
=
ControlNetModel
(
controlnet1
=
ControlNetModel
(
...
@@ -708,7 +708,7 @@ class StableDiffusionXLMultiControlNetOneModelPipelineFastTests(
...
@@ -708,7 +708,7 @@ class StableDiffusionXLMultiControlNetOneModelPipelineFastTests(
def
init_weights
(
m
):
def
init_weights
(
m
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
if
isinstance
(
m
,
torch
.
nn
.
Conv2d
):
torch
.
nn
.
init
.
normal
(
m
.
weight
)
torch
.
nn
.
init
.
normal
_
(
m
.
weight
)
m
.
bias
.
data
.
fill_
(
1.0
)
m
.
bias
.
data
.
fill_
(
1.0
)
controlnet
=
ControlNetModel
(
controlnet
=
ControlNetModel
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment