ironjr commited on
Commit
bb236fa
1 Parent(s): 09dc574

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +4 -1
model.py CHANGED
@@ -173,7 +173,8 @@ class StreamMultiDiffusion(nn.Module):
173
  self.latent_width = int(width // self.pipe.vae_scale_factor)
174
 
175
  # For bootstrapping.
176
- self.white = self.encode_imgs(torch.ones(1, 3, height, width, dtype=self.dtype, device=self.device))
 
177
 
178
  # StreamDiffusion setting.
179
  self.t_list = t_index_list
@@ -441,6 +442,8 @@ class StreamMultiDiffusion(nn.Module):
441
  self.state['background'].embed = embed
442
 
443
  if self.bootstrap_steps[0] > 0:
 
 
444
  mix_ratio = self.bootstrap_mix_ratios[:, None, None, None]
445
  self.bootstrap_latent = mix_ratio * self.white + (1.0 - mix_ratio) * self.state['background'].latent
446
 
 
173
  self.latent_width = int(width // self.pipe.vae_scale_factor)
174
 
175
  # For bootstrapping.
176
+ # self.white = self.encode_imgs(torch.ones(1, 3, height, width, dtype=self.dtype, device=self.device))
177
+ self.white = None
178
 
179
  # StreamDiffusion setting.
180
  self.t_list = t_index_list
 
442
  self.state['background'].embed = embed
443
 
444
  if self.bootstrap_steps[0] > 0:
445
+ if self.white is None:
446
+ self.white = self.encode_imgs(torch.ones(1, 3, self.height, self.width, dtype=self.dtype, device=self.device))
447
  mix_ratio = self.bootstrap_mix_ratios[:, None, None, None]
448
  self.bootstrap_latent = mix_ratio * self.white + (1.0 - mix_ratio) * self.state['background'].latent
449