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
1281f933
Commit
1281f933
authored
Jun 15, 2024
by
comfyanonymous
Browse files
Small optimization.
parent
f2e844e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
comfy/ldm/modules/diffusionmodules/mmdit.py
comfy/ldm/modules/diffusionmodules/mmdit.py
+2
-2
No files found.
comfy/ldm/modules/diffusionmodules/mmdit.py
View file @
1281f933
...
@@ -243,9 +243,9 @@ class TimestepEmbedder(nn.Module):
...
@@ -243,9 +243,9 @@ class TimestepEmbedder(nn.Module):
half
=
dim
//
2
half
=
dim
//
2
freqs
=
torch
.
exp
(
freqs
=
torch
.
exp
(
-
math
.
log
(
max_period
)
-
math
.
log
(
max_period
)
*
torch
.
arange
(
start
=
0
,
end
=
half
,
dtype
=
torch
.
float32
)
*
torch
.
arange
(
start
=
0
,
end
=
half
,
dtype
=
torch
.
float32
,
device
=
t
.
device
)
/
half
/
half
)
.
to
(
device
=
t
.
device
)
)
args
=
t
[:,
None
].
float
()
*
freqs
[
None
]
args
=
t
[:,
None
].
float
()
*
freqs
[
None
]
embedding
=
torch
.
cat
([
torch
.
cos
(
args
),
torch
.
sin
(
args
)],
dim
=-
1
)
embedding
=
torch
.
cat
([
torch
.
cos
(
args
),
torch
.
sin
(
args
)],
dim
=-
1
)
if
dim
%
2
:
if
dim
%
2
:
...
...
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