We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://colab.research.google.com/github/huggingface/diffusion-models-class/blob/main/unit3/01_stable_diffusion_introduction.ipynb
from torchvision import transforms display(init_image) # pil image convert to torch.tensor images = transforms.Compose([transforms.ToTensor()])(init_image).unsqueeze(0).to(device,torch.float) print("Input images shape:", images.shape) # Encode to latent space with torch.no_grad(): latents = 0.18215 * pipe.vae.encode(images).latent_dist.mean print("Encoded latents shape:", latents.shape) # Decode again with torch.no_grad(): decoded_images = pipe.vae.decode(latents / 0.18215).sample print("Decoded images shape:", decoded_images.shape) display(transforms.functional.to_pil_image(decoded_images[0]))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://colab.research.google.com/github/huggingface/diffusion-models-class/blob/main/unit3/01_stable_diffusion_introduction.ipynb
The text was updated successfully, but these errors were encountered: