Yw22 commited on
Commit
206b0cc
1 Parent(s): b52a209
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -326,6 +326,7 @@ class ImageConductor:
326
  controlnet_images = rearrange(controlnet_images, "b f c h w -> b c f h w")
327
  num_controlnet_images = controlnet_images.shape[2]
328
  controlnet_images = rearrange(controlnet_images, "b c f h w -> (b f) c h w")
 
329
  controlnet_images = self.vae.encode(controlnet_images * 2. - 1.).latent_dist.sample() * 0.18215
330
  controlnet_images = rearrange(controlnet_images, "(b f) c h w -> b c f h w", f=num_controlnet_images)
331
 
@@ -517,7 +518,8 @@ with block as demo:
517
  gr.Markdown(instructions)
518
 
519
 
520
- device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
 
521
  unet_path = 'models/unet.ckpt'
522
  image_controlnet_path = 'models/image_controlnet.ckpt'
523
  flow_controlnet_path = 'models/flow_controlnet.ckpt'
 
326
  controlnet_images = rearrange(controlnet_images, "b f c h w -> b c f h w")
327
  num_controlnet_images = controlnet_images.shape[2]
328
  controlnet_images = rearrange(controlnet_images, "b c f h w -> (b f) c h w")
329
+ self.vae.to(device)
330
  controlnet_images = self.vae.encode(controlnet_images * 2. - 1.).latent_dist.sample() * 0.18215
331
  controlnet_images = rearrange(controlnet_images, "(b f) c h w -> b c f h w", f=num_controlnet_images)
332
 
 
518
  gr.Markdown(instructions)
519
 
520
 
521
+ # device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
522
+ device = torch.device("cuda")
523
  unet_path = 'models/unet.ckpt'
524
  image_controlnet_path = 'models/image_controlnet.ckpt'
525
  flow_controlnet_path = 'models/flow_controlnet.ckpt'