(x)
| 252 | assert background is None or (background.shape[1] == resolution[0] and background.shape[2] == resolution[1]) |
| 253 | |
| 254 | def prepare_input_vector(x): |
| 255 | x = torch.tensor(x, dtype=torch.float32, device='cuda') if not torch.is_tensor(x) else x |
| 256 | return x[:, None, None, :] if len(x.shape) == 2 else x |
| 257 | |
| 258 | def composite_buffer(key, layers, background, antialias): |
| 259 | accum = background |