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

Method __init__

src/diffusers/models/embeddings.py:544–564  ·  view source on GitHub ↗
(self, image_embed_dim: int = 768, time_embed_dim: int = 1536)

Source from the content-addressed store, hash-verified

542
543class ImageHintTimeEmbedding(nn.Module):
544 def __init__(self, image_embed_dim: int = 768, time_embed_dim: int = 1536):
545 super().__init__()
546 self.image_proj = nn.Linear(image_embed_dim, time_embed_dim)
547 self.image_norm = nn.LayerNorm(time_embed_dim)
548 self.input_hint_block = nn.Sequential(
549 nn.Conv2d(3, 16, 3, padding=1),
550 nn.SiLU(),
551 nn.Conv2d(16, 16, 3, padding=1),
552 nn.SiLU(),
553 nn.Conv2d(16, 32, 3, padding=1, stride=2),
554 nn.SiLU(),
555 nn.Conv2d(32, 32, 3, padding=1),
556 nn.SiLU(),
557 nn.Conv2d(32, 96, 3, padding=1, stride=2),
558 nn.SiLU(),
559 nn.Conv2d(96, 96, 3, padding=1),
560 nn.SiLU(),
561 nn.Conv2d(96, 256, 3, padding=1, stride=2),
562 nn.SiLU(),
563 nn.Conv2d(256, 4, 3, padding=1),
564 )
565
566 def forward(self, image_embeds: torch.FloatTensor, hint: torch.FloatTensor):
567 # image

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected