-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Standardize on using image argument in all pipelines
#1361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize on using image argument in all pipelines
#1361
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
37d4299 to
ce1fd9f
Compare
image in all pipelinesimage argument in all pipelines
013aced to
2f84003
Compare
| def __call__( | ||
| self, | ||
| init_image: Union[torch.Tensor, PIL.Image.Image], | ||
| image: Union[torch.Tensor, PIL.Image.Image], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will have to deprecate init_image here to not surprise the user here too much. Could you implement the same logic we're using for schedulers for all pipelines:
| predict_epsilon = deprecate("predict_epsilon", "0.10.0", message, take_from=kwargs) |
Here would should do the following in addition to renaming init_image to image:
- Add a
**kwargsargument to the function call
message = (
"Please make sure to use `image` instead of `init_image`."
)
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
image = init_image or imageThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do this for all pipelines :-)
patrickvonplaten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nice PR @fboulnois !
Everything looks very nice to me except for deprecating init_image correctly.
Could you try to implement https://github.com/huggingface/diffusers/pull/1361/files#r1033477098 for all pipelines (src/pipelines) + community?
Let me know if you need any help :-)
2f84003 to
2656a78
Compare
|
@patrickvonplaten Done! Rebased on main, added deprecation warnings to community and core pipelines, and all tests pass. |
| (nsfw) content, according to the `safety_checker`. | ||
| """ | ||
| message = "Please use `image` instead of `init_image`." | ||
| init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
patrickvonplaten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super clean! Great job @fboulnois 🥳
Merging :-)
This standardizes the use of the argument
imagein all pipelines instead of a mix ofinit_imageandimage.Resolves #1257