Spaces:
Runtime error
Runtime error
Commit
·
1f8aaef
1
Parent(s):
ae12499
Update utils.py
Browse files
utils.py
CHANGED
@@ -46,7 +46,7 @@ def sample_frame(model: LatentDiffusion, prompt: str, image_sequence: torch.Tens
|
|
46 |
print ('sleeping')
|
47 |
#time.sleep(120)
|
48 |
print ('finished sleeping')
|
49 |
-
samples_ddim = model.p_sample_loop(cond=c, shape=[1, 3, 64, 64], return_intermediates=False, verbose=True)
|
50 |
#samples_ddim, _ = sampler.sample(S=999,
|
51 |
# conditioning=c,
|
52 |
# batch_size=1,
|
@@ -56,8 +56,8 @@ def sample_frame(model: LatentDiffusion, prompt: str, image_sequence: torch.Tens
|
|
56 |
# unconditional_conditioning=uc,
|
57 |
# eta=0)
|
58 |
|
59 |
-
x_samples_ddim = model.decode_first_stage(samples_ddim)
|
60 |
-
|
61 |
#x_samples_ddim = torch.clamp((x_samples_ddim + 1.0) / 2.0, min=0.0, max=1.0)
|
62 |
x_samples_ddim = torch.clamp(x_samples_ddim, min=-1.0, max=1.0)
|
63 |
|
|
|
46 |
print ('sleeping')
|
47 |
#time.sleep(120)
|
48 |
print ('finished sleeping')
|
49 |
+
#samples_ddim = model.p_sample_loop(cond=c, shape=[1, 3, 64, 64], return_intermediates=False, verbose=True)
|
50 |
#samples_ddim, _ = sampler.sample(S=999,
|
51 |
# conditioning=c,
|
52 |
# batch_size=1,
|
|
|
56 |
# unconditional_conditioning=uc,
|
57 |
# eta=0)
|
58 |
|
59 |
+
#x_samples_ddim = model.decode_first_stage(samples_ddim)
|
60 |
+
x_samples_ddim = pos_map.to(c['c_concat'].device).unsqueeze(0).expand(-1, 3)
|
61 |
#x_samples_ddim = torch.clamp((x_samples_ddim + 1.0) / 2.0, min=0.0, max=1.0)
|
62 |
x_samples_ddim = torch.clamp(x_samples_ddim, min=-1.0, max=1.0)
|
63 |
|