diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

[WIP] Latnet (and Stable) diffusion text2img conversion script.

Open patil-suraj opened this issue 1 year ago • 1 comments

This PR adds conversion script for text2img latent diffusion models from CompVis.

patil-suraj avatar Aug 05 '22 11:08 patil-suraj

The documentation is not available anymore as the PR was closed or merged.

@patil-suraj Do you have any plans for reverse functionality? I.e. diffusers .bin -> original .ckpt? Your knowledge would help us greatly

kabachuha avatar Oct 01 '22 11:10 kabachuha

Hi @kabachuha! Work towards that goal is being coordinated in issue #672, where you have participated :) It looks like @rashmimarganiatgithub is taking a go at it!

pcuenca avatar Oct 01 '22 22:10 pcuenca

Are there docs for this?

NicholasKao1029 avatar Jan 26 '23 00:01 NicholasKao1029

Hi @NicholasKao1029 you can check the docstring here, the script can now be called as a function https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py#L778

patil-suraj avatar Jan 26 '23 08:01 patil-suraj

Thanks @patil-suraj is it correct to say that this conversion is a perfect 1:1.

As in ckpt 1 -> diffusers -> ckpt 2 ckpt 1 == ckpt2

NicholasKao1029 avatar Jan 26 '23 18:01 NicholasKao1029

Yes, it should be 1:1

patil-suraj avatar Jan 26 '23 19:01 patil-suraj

Very nice thanks, can I also confirm that safetensors transformation is the same way (also outputting to a safetensors)

NicholasKao1029 avatar Jan 26 '23 20:01 NicholasKao1029

The script convert ckpt safetensors to diffusers but with native torch doesn't output safetensors yet

patil-suraj avatar Jan 27 '23 09:01 patil-suraj