Skip to content
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

No difference when using consistencydecoder in diffusers #16

Open
howardgriffin opened this issue Nov 15, 2023 · 1 comment
Open

No difference when using consistencydecoder in diffusers #16

howardgriffin opened this issue Nov 15, 2023 · 1 comment

Comments

@howardgriffin
Copy link

Here is my code, however, there seems no difference between gan_vae and cosistency_vae. What's wrong?

import torch
from diffusers import StableDiffusionPipeline, ConsistencyDecoderVAE
vae = ConsistencyDecoderVAE.from_pretrained("openai/consistency-decoder", torch_dtype=torch.float16)
pipe_gan = StableDiffusionPipeline.from_pretrained( "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16 ).to("cuda")
pipe_consistency = StableDiffusionPipeline.from_pretrained( "runwayml/stable-diffusion-v1-5", vae=vae, torch_dtype=torch.float16).to("cuda")
image_gan = pipe_gan("a girl hold flower", generator=torch.manual_seed(0)).images[0]
image_consistency = pipe_consistency("a girl hold flower", generator=torch.manual_seed(0)).images[0]

@EdoardoBotta
Copy link

The output images in your example are actually slightly different. Checking how many entries match between the two tensors:

import torchvision.transforms as transforms

transform = transforms.Compose([ 
    transforms.PILToTensor() 
]) 

equals = transform(image_gan) == transform(image_consistency)
equals.sum() / torch.numel(equals)

returns

tensor(0.1281)

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

No branches or pull requests

2 participants