1inkusFace commited on
Commit
34a1890
·
verified ·
1 Parent(s): fe9701a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -110,9 +110,10 @@ def generate(segment, image, prompt, size, guidance_scale, num_inference_steps,
110
  num_channels_latents = int(num_channels_latents / 2)
111
  image = Image.open(image.name).convert('RGB')
112
  image.resize((size,size), Image.LANCZOS)
113
- image = pipe.video_processor.preprocess(image, height=size, width=size).to(
 
114
  device, dtype=prompt_embeds.dtype
115
- )
116
  num_latent_frames = (frames - 1) // pipe.vae_scale_factor_temporal + 1
117
  latents = pipe.prepare_latents(
118
  batch_size=1, num_channels_latents=pipe.transformer.config.in_channels, height=size, width=size, num_frames=frames,
 
110
  num_channels_latents = int(num_channels_latents / 2)
111
  image = Image.open(image.name).convert('RGB')
112
  image.resize((size,size), Image.LANCZOS)
113
+ with torch.no_grad():
114
+ image = pipe.video_processor.preprocess(image, height=size, width=size).to(
115
  device, dtype=prompt_embeds.dtype
116
+ )
117
  num_latent_frames = (frames - 1) // pipe.vae_scale_factor_temporal + 1
118
  latents = pipe.prepare_latents(
119
  batch_size=1, num_channels_latents=pipe.transformer.config.in_channels, height=size, width=size, num_frames=frames,