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
chenpangpang
ComfyUI
Commits
261bcbb0
Commit
261bcbb0
authored
Dec 22, 2023
by
comfyanonymous
Browse files
A few missing comfy ops in the VAE.
parent
d35267e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
comfy/ldm/models/autoencoder.py
comfy/ldm/models/autoencoder.py
+3
-2
comfy/ldm/modules/diffusionmodules/model.py
comfy/ldm/modules/diffusionmodules/model.py
+1
-1
No files found.
comfy/ldm/models/autoencoder.py
View file @
261bcbb0
...
@@ -8,6 +8,7 @@ from comfy.ldm.modules.distributions.distributions import DiagonalGaussianDistri
...
@@ -8,6 +8,7 @@ from comfy.ldm.modules.distributions.distributions import DiagonalGaussianDistri
from
comfy.ldm.util
import
instantiate_from_config
from
comfy.ldm.util
import
instantiate_from_config
from
comfy.ldm.modules.ema
import
LitEma
from
comfy.ldm.modules.ema
import
LitEma
import
comfy.ops
class
DiagonalGaussianRegularizer
(
torch
.
nn
.
Module
):
class
DiagonalGaussianRegularizer
(
torch
.
nn
.
Module
):
def
__init__
(
self
,
sample
:
bool
=
True
):
def
__init__
(
self
,
sample
:
bool
=
True
):
...
@@ -161,12 +162,12 @@ class AutoencodingEngineLegacy(AutoencodingEngine):
...
@@ -161,12 +162,12 @@ class AutoencodingEngineLegacy(AutoencodingEngine):
},
},
**
kwargs
,
**
kwargs
,
)
)
self
.
quant_conv
=
torch
.
nn
.
Conv2d
(
self
.
quant_conv
=
comfy
.
ops
.
disable_weight_init
.
Conv2d
(
(
1
+
ddconfig
[
"double_z"
])
*
ddconfig
[
"z_channels"
],
(
1
+
ddconfig
[
"double_z"
])
*
ddconfig
[
"z_channels"
],
(
1
+
ddconfig
[
"double_z"
])
*
embed_dim
,
(
1
+
ddconfig
[
"double_z"
])
*
embed_dim
,
1
,
1
,
)
)
self
.
post_quant_conv
=
torch
.
nn
.
Conv2d
(
embed_dim
,
ddconfig
[
"z_channels"
],
1
)
self
.
post_quant_conv
=
comfy
.
ops
.
disable_weight_init
.
Conv2d
(
embed_dim
,
ddconfig
[
"z_channels"
],
1
)
self
.
embed_dim
=
embed_dim
self
.
embed_dim
=
embed_dim
def
get_autoencoder_params
(
self
)
->
list
:
def
get_autoencoder_params
(
self
)
->
list
:
...
...
comfy/ldm/modules/diffusionmodules/model.py
View file @
261bcbb0
...
@@ -41,7 +41,7 @@ def nonlinearity(x):
...
@@ -41,7 +41,7 @@ def nonlinearity(x):
def
Normalize
(
in_channels
,
num_groups
=
32
):
def
Normalize
(
in_channels
,
num_groups
=
32
):
return
torch
.
nn
.
GroupNorm
(
num_groups
=
num_groups
,
num_channels
=
in_channels
,
eps
=
1e-6
,
affine
=
True
)
return
ops
.
GroupNorm
(
num_groups
=
num_groups
,
num_channels
=
in_channels
,
eps
=
1e-6
,
affine
=
True
)
class
Upsample
(
nn
.
Module
):
class
Upsample
(
nn
.
Module
):
...
...
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