def enc_image(img_file):
    img_t = torch.from_numpy((img_read(img_file) / 255.0)).unsqueeze(0).permute(0, 3, 1, 2).cuda()[:, :3, :, :]
    in_sliced = slice_imgs([img_t], a.samples, a.modsize, transforms.normalize(), a.align)[0]
    emb = model_clip.encode_image(in_sliced)
    return emb.detach().clone()
def enc_image(img_file):
    img_t = torch.from_numpy((img_read(img_file) / 255.0)).unsqueeze(0).permute(0, 3, 1, 2).cuda()[:, :3, :, :]
    in_sliced = slice_imgs([img_t], a.samples, a.modsize, transforms.normalize(), a.align)[0]
    emb = model_clip.encode_image(in_sliced)
    return emb.detach().clone()