MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / _video_vae

Function _video_vae

models/cosmos_predict2.py:48–71  ·  view source on GitHub ↗

Autoencoder3d adapted from Stable Diffusion 1.x, 2.x and XL.

(pretrained_path=None, z_dim=None, device='cpu', **kwargs)

Source from the content-addressed store, hash-verified

46
47
48def _video_vae(pretrained_path=None, z_dim=None, device='cpu', **kwargs):
49 """
50 Autoencoder3d adapted from Stable Diffusion 1.x, 2.x and XL.
51 """
52 # params
53 cfg = dict(
54 dim=96,
55 z_dim=z_dim,
56 dim_mult=[1, 2, 4, 4],
57 num_res_blocks=2,
58 attn_scales=[],
59 temperal_downsample=[False, True, True],
60 dropout=0.0)
61 cfg.update(**kwargs)
62
63 # init model
64 with torch.device('meta'):
65 model = WanVAE_(**cfg)
66
67 # load checkpoint
68 model.load_state_dict(
69 load_state_dict(pretrained_path), assign=True)
70
71 return model
72
73
74class WanVAE:

Callers 1

__init__Method · 0.70

Calls 3

WanVAE_Class · 0.90
load_state_dictFunction · 0.90
load_state_dictMethod · 0.45

Tested by

no test coverage detected