Multiplying by 255 works for me, so I’m unsure which approaches you’ve used:
# create random image
cpy_img = np.random.randint(0, 255, (100, 100, 3)).astype(np.uint8)
cpy_img = PIL.Image.fromarray(cpy_img)

# ToTensor returns a tensor in the range [0, 1]
preprocess_img = transforms.Compose([transforms.ToTensor()])(cpy_img) 
# add dimension
out_img_tensor = preprocess_img.squeeze(0)
# transform float32 [0, 1] to uint8 [0, 255], which will create the black image
out_img_type = out_img_tensor.type(torch.uint8)
print((out_img_type==0).sum()) # all zeros
plt.imshow(out_img_type.permute(1, 2, 0).numpy()) # all black

print(out_img_tensor.min(), out_img_tensor.max())
> tensor(0.) tensor(0.9961)

out_img_tensor = out_img_tensor * 255
out_img_type = out_img_tensor.type(torch.uint8)
plt.imshow(out_img_type.permute(1, 2, 0).numpy()) # works

I can’t point you to a specific article, as the error is caused by transforming floating point data in the range [0, 1] to uint8, which will create an (almost) all-black image.