Browse Source

add convert to RGB

pull/2/head
oriBetelgeuse 5 years ago
parent
commit
82647573f4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      rudalle/image_prompts.py

+ 1
- 1
rudalle/image_prompts.py View File

@ -19,7 +19,7 @@ class ImagePrompts:
self.image_prompts_idx, self.image_prompts = self._get_image_prompts(img, borders, vae, crop_first)
def _preprocess_img(self, pil_img):
img = torch.tensor(np.array(pil_img).transpose(2, 0, 1)) / 255.
img = torch.tensor(np.array(pil_img.convert('RGB')).transpose(2, 0, 1)) / 255.
img = img.unsqueeze(0).to(self.device, dtype=torch.float32)
img = (2 * img) - 1
return img


Loading…
Cancel
Save