Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
db829a4b
Unverified
Commit
db829a4b
authored
Aug 17, 2024
by
Álvaro Somoza
Committed by
GitHub
Aug 17, 2024
Browse files
[IP Adapter] Fix object has no attribute with image encoder (#9194)
* fix * apply suggestion
parent
e780c05c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/diffusers/loaders/ip_adapter.py
src/diffusers/loaders/ip_adapter.py
+5
-1
No files found.
src/diffusers/loaders/ip_adapter.py
View file @
db829a4b
...
@@ -222,7 +222,11 @@ class IPAdapterMixin:
...
@@ -222,7 +222,11 @@ class IPAdapterMixin:
# create feature extractor if it has not been registered to the pipeline yet
# create feature extractor if it has not been registered to the pipeline yet
if
hasattr
(
self
,
"feature_extractor"
)
and
getattr
(
self
,
"feature_extractor"
,
None
)
is
None
:
if
hasattr
(
self
,
"feature_extractor"
)
and
getattr
(
self
,
"feature_extractor"
,
None
)
is
None
:
clip_image_size
=
self
.
image_encoder
.
config
.
image_size
# FaceID IP adapters don't need the image encoder so it's not present, in this case we default to 224
default_clip_size
=
224
clip_image_size
=
(
self
.
image_encoder
.
config
.
image_size
if
self
.
image_encoder
is
not
None
else
default_clip_size
)
feature_extractor
=
CLIPImageProcessor
(
size
=
clip_image_size
,
crop_size
=
clip_image_size
)
feature_extractor
=
CLIPImageProcessor
(
size
=
clip_image_size
,
crop_size
=
clip_image_size
)
self
.
register_modules
(
feature_extractor
=
feature_extractor
)
self
.
register_modules
(
feature_extractor
=
feature_extractor
)
...
...
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