diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Allow latent output_type when using StableDiffusionImg2ImgPipeline

Open thomasnappi opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. Currently, the StableDiffusionImg2ImgPipeline cannot output latents the way that the base StableDiffusionPipeline can. I think this would be a very desirable feature, especially with the arrival of the latent upscaler: https://huggingface.co/stabilityai/sd-x2-latent-upscaler

Describe the solution you'd like Allow the user to specify returning latents in StableDiffusionImg2ImgPipeline. It just needs a check before decoding them, the same as in the StableDiffusionPipeline.

Describe alternatives you've considered Creating a custom pipeline to do the same

Additional context No additional context

thomasnappi avatar Feb 15 '23 00:02 thomasnappi

I think this makes sense. What are your thoughts @yiyixuxu ?

pcuenca avatar Feb 15 '23 12:02 pcuenca

@pcuenca yes - maybe makes sense to add to all other pipelines too?

yiyixuxu avatar Feb 15 '23 15:02 yiyixuxu

@thomasnappi we love your suggestion! would you be interested in submitting a PR? 🤗😇

yiyixuxu avatar Feb 15 '23 20:02 yiyixuxu

Sorry about the delay - I'm checking with my employer, if they're alright with it, I'd be happy to make a PR for this.

thomasnappi avatar Feb 18 '23 01:02 thomasnappi

I've updated the pull request for this so that all of the checks have passed. Thank you for your patience!

thomasnappi avatar Mar 01 '23 02:03 thomasnappi

Closing image as described here https://github.com/huggingface/diffusers/pull/2467#issuecomment-1477199102

Once again, super sorry I didn't catch the duplicated work sooner :(

williamberman avatar Mar 21 '23 02:03 williamberman