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
f21bb417
Commit
f21bb417
authored
Dec 26, 2023
by
comfyanonymous
Browse files
Fix taesd VAE in lowvram mode.
parent
61b3f15f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
comfy/taesd/taesd.py
comfy/taesd/taesd.py
+3
-2
No files found.
comfy/taesd/taesd.py
View file @
f21bb417
...
@@ -7,9 +7,10 @@ import torch
...
@@ -7,9 +7,10 @@ import torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
comfy.utils
import
comfy.utils
import
comfy.ops
def
conv
(
n_in
,
n_out
,
**
kwargs
):
def
conv
(
n_in
,
n_out
,
**
kwargs
):
return
nn
.
Conv2d
(
n_in
,
n_out
,
3
,
padding
=
1
,
**
kwargs
)
return
comfy
.
ops
.
disable_weight_init
.
Conv2d
(
n_in
,
n_out
,
3
,
padding
=
1
,
**
kwargs
)
class
Clamp
(
nn
.
Module
):
class
Clamp
(
nn
.
Module
):
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
...
@@ -19,7 +20,7 @@ class Block(nn.Module):
...
@@ -19,7 +20,7 @@ class Block(nn.Module):
def
__init__
(
self
,
n_in
,
n_out
):
def
__init__
(
self
,
n_in
,
n_out
):
super
().
__init__
()
super
().
__init__
()
self
.
conv
=
nn
.
Sequential
(
conv
(
n_in
,
n_out
),
nn
.
ReLU
(),
conv
(
n_out
,
n_out
),
nn
.
ReLU
(),
conv
(
n_out
,
n_out
))
self
.
conv
=
nn
.
Sequential
(
conv
(
n_in
,
n_out
),
nn
.
ReLU
(),
conv
(
n_out
,
n_out
),
nn
.
ReLU
(),
conv
(
n_out
,
n_out
))
self
.
skip
=
nn
.
Conv2d
(
n_in
,
n_out
,
1
,
bias
=
False
)
if
n_in
!=
n_out
else
nn
.
Identity
()
self
.
skip
=
comfy
.
ops
.
disable_weight_init
.
Conv2d
(
n_in
,
n_out
,
1
,
bias
=
False
)
if
n_in
!=
n_out
else
nn
.
Identity
()
self
.
fuse
=
nn
.
ReLU
()
self
.
fuse
=
nn
.
ReLU
()
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
return
self
.
fuse
(
self
.
conv
(
x
)
+
self
.
skip
(
x
))
return
self
.
fuse
(
self
.
conv
(
x
)
+
self
.
skip
(
x
))
...
...
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