MCPcopy Create free account
hub / github.com/CompVis/zigma / test_sd_1_5

Function test_sd_1_5

wandb_utils.py:115–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113
114
115def test_sd_1_5():
116 from diffusers import StableDiffusionPipeline
117 import torch
118
119 model_id = "runwayml/stable-diffusion-v1-5"
120 pipe = StableDiffusionPipeline.from_pretrained(model_id)
121 vae = pipe.vae.to("cuda")
122 img = torch.randn(4, 3, 256, 256).to("cuda")
123 with torch.no_grad():
124 latents = vae.encode(img).latent_dist.sample()
125 print(latents.shape)
126
127
128def test_webdataset_faceshq_sd1_5():

Callers

nothing calls this directly

Calls 4

from_pretrainedMethod · 0.80
toMethod · 0.80
sampleMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected