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
renzhc
diffusers_dcu
Commits
65ef7a0c
Unverified
Commit
65ef7a0c
authored
Nov 09, 2023
by
Dhruv Nair
Committed by
GitHub
Nov 08, 2023
Browse files
Fix prompt bug in AnimateDiff (#5702)
* fix prompt bug * add test
parent
6e68c715
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
src/diffusers/pipelines/animatediff/pipeline_animatediff.py
src/diffusers/pipelines/animatediff/pipeline_animatediff.py
+1
-1
tests/pipelines/animatediff/test_animatediff.py
tests/pipelines/animatediff/test_animatediff.py
+11
-0
No files found.
src/diffusers/pipelines/animatediff/pipeline_animatediff.py
View file @
65ef7a0c
...
@@ -498,7 +498,7 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, LoraLo
...
@@ -498,7 +498,7 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, LoraLo
@
torch
.
no_grad
()
@
torch
.
no_grad
()
def
__call__
(
def
__call__
(
self
,
self
,
prompt
:
Union
[
str
,
List
[
str
]],
prompt
:
Union
[
str
,
List
[
str
]]
=
None
,
num_frames
:
Optional
[
int
]
=
16
,
num_frames
:
Optional
[
int
]
=
16
,
height
:
Optional
[
int
]
=
None
,
height
:
Optional
[
int
]
=
None
,
width
:
Optional
[
int
]
=
None
,
width
:
Optional
[
int
]
=
None
,
...
...
tests/pipelines/animatediff/test_animatediff.py
View file @
65ef7a0c
...
@@ -220,6 +220,17 @@ class AnimateDiffPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
...
@@ -220,6 +220,17 @@ class AnimateDiffPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
model_dtypes
=
[
component
.
dtype
for
component
in
pipe
.
components
.
values
()
if
hasattr
(
component
,
"dtype"
)]
model_dtypes
=
[
component
.
dtype
for
component
in
pipe
.
components
.
values
()
if
hasattr
(
component
,
"dtype"
)]
self
.
assertTrue
(
all
(
dtype
==
torch
.
float16
for
dtype
in
model_dtypes
))
self
.
assertTrue
(
all
(
dtype
==
torch
.
float16
for
dtype
in
model_dtypes
))
def
test_prompt_embeds
(
self
):
components
=
self
.
get_dummy_components
()
pipe
=
self
.
pipeline_class
(
**
components
)
pipe
.
set_progress_bar_config
(
disable
=
None
)
pipe
.
to
(
torch_device
)
inputs
=
self
.
get_dummy_inputs
(
torch_device
)
inputs
.
pop
(
"prompt"
)
inputs
[
"prompt_embeds"
]
=
torch
.
randn
((
1
,
4
,
32
),
device
=
torch_device
)
pipe
(
**
inputs
)
@
slow
@
slow
@
require_torch_gpu
@
require_torch_gpu
...
...
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