Repository navigation
Restore compatibility with deprecated StableDiffusionOnnxPipeline - #1191
Conversation
I think it broke in #552.
| class StableDiffusionOnnxPipeline(OnnxStableDiffusionPipeline): | ||
| def __init__( | ||
| self, | ||
| vae_encoder: OnnxRuntimeModel, |
There was a problem hiding this comment.
Alt 1/2: remove this line
There was a problem hiding this comment.
Yes, the old pipeline didn't have an encoder, so let's remove and substitute it with **kwargs
| deprecation_message = "Please use `OnnxStableDiffusionPipeline` instead of `StableDiffusionOnnxPipeline`." | ||
| deprecate("StableDiffusionOnnxPipeline", "1.0.0", deprecation_message) | ||
| super().__init__( | ||
| vae_encoder=vae_encoder, |
There was a problem hiding this comment.
Alt 2/2: vae_encoder=None
There was a problem hiding this comment.
None would work with **kwargs as well 👍
There was a problem hiding this comment.
I'm not able to make **kwargs work, it fails later in from_pretrained because it tries to match a module named "kwargs".
In addition, omitting vae_encoder in the __init__ causes an additional warning:
Keyword arguments {'vae_encoder': ['diffusers', 'OnnxRuntimeModel']} not recognized.
So I'd be inclined to leave it as it is here. You are welcome to take another look though :)
|
Also, shouldn't we have a |
|
The documentation is not available anymore as the PR was closed or merged. |
| deprecation_message = "Please use `OnnxStableDiffusionPipeline` instead of `StableDiffusionOnnxPipeline`." | ||
| deprecate("StableDiffusionOnnxPipeline", "1.0.0", deprecation_message) | ||
| super().__init__( | ||
| vae_encoder=vae_encoder, |
There was a problem hiding this comment.
None would work with **kwargs as well 👍
| class StableDiffusionOnnxPipeline(OnnxStableDiffusionPipeline): | ||
| def __init__( | ||
| self, | ||
| vae_encoder: OnnxRuntimeModel, |
There was a problem hiding this comment.
Yes, the old pipeline didn't have an encoder, so let's remove and substitute it with **kwargs
Indeed! |
|
Thanks @pcuenca! Totally forgot about out kwargs complications, disregard my comments 😅 |
…uggingface#1191) * Restore compatibility with old ONNX pipeline. I think it broke in huggingface#552. * Add missing attribute `vae_encoder`
I think it broke in #552, but it was meant to be deprecated until
1.0.0.