MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / forward

Method forward

scripts/convert_consistency_decoder.py:260–272  ·  view source on GitHub ↗
(self, x, t)

Source from the content-addressed store, hash-verified

258 self.f_s = nn.Conv2d(in_features, out_features, kernel_size=1, padding=0) if skip_conv else nn.Identity()
259
260 def forward(self, x, t):
261 x_skip = x
262 t = self.f_t(F.silu(t))
263 t = t.chunk(2, dim=1)
264 t_1 = t[0].unsqueeze(dim=2).unsqueeze(dim=3) + 1
265 t_2 = t[1].unsqueeze(dim=2).unsqueeze(dim=3)
266
267 gn_1 = F.silu(self.gn_1(x))
268 f_1 = self.f_1(gn_1)
269
270 gn_2 = self.gn_2(f_1)
271
272 return self.f_s(x_skip) + self.f_2(F.silu(gn_2 * t_1 + t_2))
273
274
275# Also ConvResblock

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected