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
7ecb2ec1
Commit
7ecb2ec1
authored
Jun 28, 2024
by
comfyanonymous
Browse files
Audio second setting in EmptyLatentAudio.
parent
0d9009c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
comfy_extras/nodes_audio.py
comfy_extras/nodes_audio.py
+4
-3
No files found.
comfy_extras/nodes_audio.py
View file @
7ecb2ec1
...
...
@@ -14,15 +14,16 @@ class EmptyLatentAudio:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{}}
return
{
"required"
:
{
"seconds"
:
(
"FLOAT"
,
{
"default"
:
47.6
,
"min"
:
1.0
,
"max"
:
1000.0
,
"step"
:
0.1
})
}}
RETURN_TYPES
=
(
"LATENT"
,)
FUNCTION
=
"generate"
CATEGORY
=
"_for_testing/audio"
def
generate
(
self
):
def
generate
(
self
,
seconds
):
batch_size
=
1
latent
=
torch
.
zeros
([
batch_size
,
64
,
1024
],
device
=
self
.
device
)
length
=
round
((
seconds
*
44100
/
2048
)
/
2
)
*
2
latent
=
torch
.
zeros
([
batch_size
,
64
,
length
],
device
=
self
.
device
)
return
({
"samples"
:
latent
,
"type"
:
"audio"
},
)
class
VAEEncodeAudio
:
...
...
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