Spaces:
Runtime error
Runtime error
Update model.py
Browse files
model.py
CHANGED
|
@@ -461,20 +461,18 @@ class StreamMultiDiffusion(nn.Module):
|
|
| 461 |
do_classifier_free_guidance=(self.guidance_scale > 1.0),
|
| 462 |
negative_prompt=[negative_prompt],
|
| 463 |
) # ((1, 77, 768): cond, (1, 77, 768): uncond)
|
| 464 |
-
print('111111')
|
| 465 |
|
| 466 |
self.state['background'].image = image
|
| 467 |
self.state['background'].latent = (
|
| 468 |
self.encode_imgs(T.ToTensor()(image_)[None].to(self.device, self.dtype))
|
| 469 |
) # (1, 3, H, W)
|
|
|
|
| 470 |
self.state['background'].prompt = prompt
|
| 471 |
self.state['background'].negative_prompt = negative_prompt
|
| 472 |
self.state['background'].embed = embed
|
| 473 |
-
print('222222')
|
| 474 |
|
| 475 |
if self.bootstrap_steps[0] > 0:
|
| 476 |
if self.white is None:
|
| 477 |
-
print('333333333')
|
| 478 |
self.white = self.encode_imgs(torch.ones(1, 3, self.height, self.width, dtype=self.dtype, device=self.device))
|
| 479 |
mix_ratio = self.bootstrap_mix_ratios[:, None, None, None]
|
| 480 |
self.bootstrap_latent = mix_ratio * self.white + (1.0 - mix_ratio) * self.state['background'].latent
|
|
|
|
| 461 |
do_classifier_free_guidance=(self.guidance_scale > 1.0),
|
| 462 |
negative_prompt=[negative_prompt],
|
| 463 |
) # ((1, 77, 768): cond, (1, 77, 768): uncond)
|
|
|
|
| 464 |
|
| 465 |
self.state['background'].image = image
|
| 466 |
self.state['background'].latent = (
|
| 467 |
self.encode_imgs(T.ToTensor()(image_)[None].to(self.device, self.dtype))
|
| 468 |
) # (1, 3, H, W)
|
| 469 |
+
print(self.state['background'].latent.dtype, self.state['background'].latent.device, self.vae.dtype, self.vae.device)
|
| 470 |
self.state['background'].prompt = prompt
|
| 471 |
self.state['background'].negative_prompt = negative_prompt
|
| 472 |
self.state['background'].embed = embed
|
|
|
|
| 473 |
|
| 474 |
if self.bootstrap_steps[0] > 0:
|
| 475 |
if self.white is None:
|
|
|
|
| 476 |
self.white = self.encode_imgs(torch.ones(1, 3, self.height, self.width, dtype=self.dtype, device=self.device))
|
| 477 |
mix_ratio = self.bootstrap_mix_ratios[:, None, None, None]
|
| 478 |
self.bootstrap_latent = mix_ratio * self.white + (1.0 - mix_ratio) * self.state['background'].latent
|