Spaces:
Running
on
Zero
Running
on
Zero
enable zerogpu
Browse files
app.py
CHANGED
@@ -505,15 +505,16 @@ def reset_kps(img, keypoints, side: Literal["right", "left"]):
|
|
505 |
keypoints[1] = []
|
506 |
return img, keypoints
|
507 |
|
508 |
-
@spaces.GPU(duration=
|
509 |
def sample_diff(ref_cond, target_cond, target_keypts, num_gen, seed, cfg):
|
510 |
set_seed(seed)
|
511 |
z = torch.randn(
|
512 |
(num_gen, opts.latent_dim, opts.latent_size[0], opts.latent_size[1]),
|
513 |
device=device,
|
514 |
)
|
515 |
-
|
516 |
-
|
|
|
517 |
# novel view synthesis mode = off
|
518 |
nvs = torch.zeros(num_gen, dtype=torch.int, device=device)
|
519 |
z = torch.cat([z, z], 0)
|
|
|
505 |
keypoints[1] = []
|
506 |
return img, keypoints
|
507 |
|
508 |
+
@spaces.GPU(duration=60)
|
509 |
def sample_diff(ref_cond, target_cond, target_keypts, num_gen, seed, cfg):
|
510 |
set_seed(seed)
|
511 |
z = torch.randn(
|
512 |
(num_gen, opts.latent_dim, opts.latent_size[0], opts.latent_size[1]),
|
513 |
device=device,
|
514 |
)
|
515 |
+
print(f"z.device: {z.device}")
|
516 |
+
target_cond = target_cond.repeat(num_gen, 1, 1, 1).to(z.device)
|
517 |
+
ref_cond = ref_cond.repeat(num_gen, 1, 1, 1).to(z.device)
|
518 |
# novel view synthesis mode = off
|
519 |
nvs = torch.zeros(num_gen, dtype=torch.int, device=device)
|
520 |
z = torch.cat([z, z], 0)
|