(self, x, hint, timesteps, context, **kwargs)
| 291 | return TimestepEmbedSequential(zero_module(conv_nd(self.dims, channels, channels, 1, padding=0))) |
| 292 | |
| 293 | def forward(self, x, hint, timesteps, context, **kwargs): |
| 294 | t_emb = timestep_embedding(timesteps, self.model_channels, repeat_only=False) |
| 295 | emb = self.time_embed(t_emb) |
| 296 | |
| 297 | guided_hint = self.input_hint_block(hint, emb, context) |
| 298 | |
| 299 | outs = [] |
| 300 | |
| 301 | h = x.type(self.dtype) |
| 302 | for module, zero_conv in zip(self.input_blocks, self.zero_convs): |
| 303 | if guided_hint is not None: |
| 304 | h = module(h, emb, context) |
| 305 | h += guided_hint |
| 306 | guided_hint = None |
| 307 | else: |
| 308 | h = module(h, emb, context) |
| 309 | outs.append(zero_conv(h, emb, context)) |
| 310 | |
| 311 | h = self.middle_block(h, emb, context) |
| 312 | outs.append(self.middle_block_out(h, emb, context)) |
| 313 | |
| 314 | return outs |
| 315 | |
| 316 | |
| 317 | class ControlLDM(LatentDiffusion): |
nothing calls this directly
no test coverage detected