Update src/pipeline.py
Browse files- src/pipeline.py +1 -1
src/pipeline.py
CHANGED
|
@@ -155,7 +155,7 @@ def infer(request: TextToImageRequest, pipeline: Pipeline, generator: Generator)
|
|
| 155 |
torch.cuda.empty_cache()
|
| 156 |
|
| 157 |
latents=pipeline(request.prompt,generator=generator, guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256, height=request.height, width=request.width, output_type="latent").images
|
| 158 |
-
latents =
|
| 159 |
images = pipeline.vae.decode(latents, return_dict=False)[0]
|
| 160 |
image = image_processor.postprocess(images[0].unsqueeze(0).mul_(2).sub_(1), output_type='pil')[0]
|
| 161 |
return image
|
|
|
|
| 155 |
torch.cuda.empty_cache()
|
| 156 |
|
| 157 |
latents=pipeline(request.prompt,generator=generator, guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256, height=request.height, width=request.width, output_type="latent").images
|
| 158 |
+
latents = pipeline._unpack_latents(latents, request.height, request.width, 2 ** (len(pipeline.vae.config.block_out_channels)))
|
| 159 |
images = pipeline.vae.decode(latents, return_dict=False)[0]
|
| 160 |
image = image_processor.postprocess(images[0].unsqueeze(0).mul_(2).sub_(1), output_type='pil')[0]
|
| 161 |
return image
|