MCPcopy Create free account
hub / github.com/cubiq/ComfyUI_IPAdapter_plus / tensor_to_image

Function tensor_to_image

utils.py:380–383  ·  view source on GitHub ↗
(tensor)

Source from the content-addressed store, hash-verified

378 return output
379
380def tensor_to_image(tensor):
381 image = tensor.mul(255).clamp(0, 255).byte().cpu()
382 image = image[..., [2, 1, 0]].numpy()
383 return image
384
385def image_to_tensor(image):
386 tensor = torch.clamp(torch.from_numpy(image).float() / 255., 0, 1)

Callers 1

ipadapter_executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected