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
61b3f15f
"doc/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "39ee81b9cd57e443f036cba9f2e2bb1052766589"
Commit
61b3f15f
authored
Dec 26, 2023
by
comfyanonymous
Browse files
Fix lowvram mode not working with unCLIP and Revision code.
parent
392878a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
comfy/ldm/modules/diffusionmodules/upscaling.py
comfy/ldm/modules/diffusionmodules/upscaling.py
+2
-2
comfy/ldm/modules/encoders/noise_aug_modules.py
comfy/ldm/modules/encoders/noise_aug_modules.py
+2
-2
No files found.
comfy/ldm/modules/diffusionmodules/upscaling.py
View file @
61b3f15f
...
@@ -43,8 +43,8 @@ class AbstractLowScaleModel(nn.Module):
...
@@ -43,8 +43,8 @@ class AbstractLowScaleModel(nn.Module):
def
q_sample
(
self
,
x_start
,
t
,
noise
=
None
):
def
q_sample
(
self
,
x_start
,
t
,
noise
=
None
):
noise
=
default
(
noise
,
lambda
:
torch
.
randn_like
(
x_start
))
noise
=
default
(
noise
,
lambda
:
torch
.
randn_like
(
x_start
))
return
(
extract_into_tensor
(
self
.
sqrt_alphas_cumprod
,
t
,
x_start
.
shape
)
*
x_start
+
return
(
extract_into_tensor
(
self
.
sqrt_alphas_cumprod
.
to
(
x_start
.
device
)
,
t
,
x_start
.
shape
)
*
x_start
+
extract_into_tensor
(
self
.
sqrt_one_minus_alphas_cumprod
,
t
,
x_start
.
shape
)
*
noise
)
extract_into_tensor
(
self
.
sqrt_one_minus_alphas_cumprod
.
to
(
x_start
.
device
)
,
t
,
x_start
.
shape
)
*
noise
)
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
return
x
,
None
return
x
,
None
...
...
comfy/ldm/modules/encoders/noise_aug_modules.py
View file @
61b3f15f
...
@@ -15,12 +15,12 @@ class CLIPEmbeddingNoiseAugmentation(ImageConcatWithNoiseAugmentation):
...
@@ -15,12 +15,12 @@ class CLIPEmbeddingNoiseAugmentation(ImageConcatWithNoiseAugmentation):
def
scale
(
self
,
x
):
def
scale
(
self
,
x
):
# re-normalize to centered mean and unit variance
# re-normalize to centered mean and unit variance
x
=
(
x
-
self
.
data_mean
)
*
1.
/
self
.
data_std
x
=
(
x
-
self
.
data_mean
.
to
(
x
.
device
)
)
*
1.
/
self
.
data_std
.
to
(
x
.
device
)
return
x
return
x
def
unscale
(
self
,
x
):
def
unscale
(
self
,
x
):
# back to original data stats
# back to original data stats
x
=
(
x
*
self
.
data_std
)
+
self
.
data_mean
x
=
(
x
*
self
.
data_std
.
to
(
x
.
device
)
)
+
self
.
data_mean
.
to
(
x
.
device
)
return
x
return
x
def
forward
(
self
,
x
,
noise_level
=
None
):
def
forward
(
self
,
x
,
noise_level
=
None
):
...
...
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