mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-14 05:41:06 +01:00
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.9, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, --use-pytorch-cross-attention, macos, 3.10, [self-hosted macOS], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, --use-pytorch-cross-attention, macos, 3.11, [self-hosted macOS], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, --use-pytorch-cross-attention, macos, 3.12, [self-hosted macOS], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, --use-pytorch-cross-attention, macos, 3.9, [self-hosted macOS], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, --use-pytorch-cross-attention, macos, 3.11, [self-hosted macOS], nightly) (push) Has been cancelled
Execution Tests / test (macos-latest) (push) Has been cancelled
Execution Tests / test (ubuntu-latest) (push) Has been cancelled
Execution Tests / test (windows-latest) (push) Has been cancelled
Test server launches without errors / test (push) Has been cancelled
Unit Tests / test (macos-latest) (push) Has been cancelled
Unit Tests / test (ubuntu-latest) (push) Has been cancelled
Unit Tests / test (windows-latest) (push) Has been cancelled
17 lines
528 B
Python
17 lines
528 B
Python
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
|
|
|