MCPcopy Create free account
hub / github.com/FireRedTeam/LayerDiffuse-Flux / __init__

Method __init__

lib_layerdiffuse/vae.py:415–429  ·  view source on GitHub ↗
(self, filename, dtype=torch.float16, alpha=300.0, *args, **kwargs)

Source from the content-addressed store, hash-verified

413
414class TransparentVAEEncoder(torch.nn.Module):
415 def __init__(self, filename, dtype=torch.float16, alpha=300.0, *args, **kwargs):
416 super().__init__(*args, **kwargs)
417 sd = sf.load_file(filename)
418 self.dtype = dtype
419
420 model = LatentTransparencyOffsetEncoder()
421 model.load_state_dict(sd, strict=True)
422 model.to(dtype=self.dtype)
423 model.eval()
424
425 self.model = model
426
427 # similar to LoRA's alpha to avoid initial zero-initialized outputs being too small
428 self.alpha = alpha
429 return
430
431 @torch.no_grad()
432 def forward(self, sd_vae, list_of_np_rgba_hwc_uint8, use_offset=True):

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected