Skip to content

Conversation

@patil-suraj
Copy link
Contributor

@patil-suraj patil-suraj commented Aug 5, 2022

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

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 5, 2022

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

@patrickvonplaten patrickvonplaten changed the title [WIP] Latnet (and Stable) diffusion text2img conversion script. Stable diffusion text2img conversion script. Sep 15, 2022
@patrickvonplaten patrickvonplaten merged commit 039958e into main Sep 15, 2022
@patrickvonplaten patrickvonplaten deleted the ldm-txt2im-conv-script branch September 15, 2022 22:07
@kabachuha
Copy link
Contributor

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

@pcuenca
Copy link
Member

pcuenca commented Oct 1, 2022

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!

@NicholasKao1029
Copy link

Are there docs for this?

@patil-suraj
Copy link
Contributor Author

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

@NicholasKao1029
Copy link

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

@patil-suraj
Copy link
Contributor Author

Yes, it should be 1:1

@NicholasKao1029
Copy link

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

@patil-suraj
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants