MCPcopy Create free account
hub / github.com/SwayStar123/SpeedrunDiT / encode

Method encode

preprocessing/encoders.py:79–83  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

77 return self._vae.encode(x).sample()
78
79 def encode(self, x): # raw pixels => raw latents
80 self.init(x.device)
81 x = x.to(torch.float32) / 127.5 - 1
82 x = torch.cat([self._run_vae_encoder(batch) for batch in x.split(self.batch_size)])
83 return x
84
85#----------------------------------------------------------------------------
86

Callers 4

encode_image_workerFunction · 0.95
_run_vae_encoderMethod · 0.45
folder_write_bytesFunction · 0.45
open_urlFunction · 0.45

Calls 2

initMethod · 0.95
_run_vae_encoderMethod · 0.95

Tested by

no test coverage detected