diffrp.utils.exchange#

diffrp.utils.exchange.to_pil(rgb_or_rgba: Tensor)#

Convert a RGB or RGBA tensor to an PIL Image. The tensor is assumed to have range [0, 1]. Values beyond that are clamped.

Returns:

The converted PIL Image.

Return type:

Image

diffrp.utils.exchange.torch_load_no_warning(fn: str)#