Chaerin5 commited on
Commit
85dfb6a
·
1 Parent(s): b61bdbb

enable zerogpu

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -262,6 +262,7 @@ def make_ref_cond(
262
  print("ready to run autoencoder")
263
  # print(f"image.device: {image.device}, type(image): {type(image)}")
264
  # image = image.to("cuda")
 
265
  latent = opts.latent_scaling_factor * autoencoder.encode(image[None, ...]).sample()
266
  return image[None, ...], latent
267
 
@@ -547,6 +548,8 @@ def sample_diff(ref_cond, target_cond, target_keypts, num_gen, seed, cfg):
547
  else:
548
  results.append(placeholder)
549
  results_pose.append(placeholder)
 
 
550
  return results, results_pose
551
 
552
  @spaces.GPU(duration=120)
 
262
  print("ready to run autoencoder")
263
  # print(f"image.device: {image.device}, type(image): {type(image)}")
264
  # image = image.to("cuda")
265
+ print(f"autoencoder.encoder.device: {autoencoder.encoder.device}")
266
  latent = opts.latent_scaling_factor * autoencoder.encode(image[None, ...]).sample()
267
  return image[None, ...], latent
268
 
 
548
  else:
549
  results.append(placeholder)
550
  results_pose.append(placeholder)
551
+ Image.fromarray(results[0]).save("sampled_image.png")
552
+ print("sampled_image.png saved")
553
  return results, results_pose
554
 
555
  @spaces.GPU(duration=120)