ACCC1380/molab-checkpoints / ComfyUI /comfy /pixel_space_convert.py
ACCC1380's picture
download
raw
528 Bytes
import torch
# "Fake" VAE that converts from IMAGE B, H, W, C and values on the scale of 0..1
# to LATENT B, C, H, W and values on the scale of -1..1.
class PixelspaceConversionVAE(torch.nn.Module):
def __init__(self):
super().__init__()
self.pixel_space_vae = torch.nn.Parameter(torch.tensor(1.0))
def encode(self, pixels: torch.Tensor, *_args, **_kwargs) -> torch.Tensor:
return pixels
def decode(self, samples: torch.Tensor, *_args, **_kwargs) -> torch.Tensor:
return samples

Xet Storage Details

Size:
528 Bytes
·
Xet hash:
125bdaa44b42fc630412f99073d710b02510b97765503de60536e7a4850a8235

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.