MCPcopy Create free account
hub / github.com/MeiGen-AI/MultiTalk / _pillow_convert

Method _pillow_convert

wan/utils/vace_processor.py:15–28  ·  view source on GitHub ↗
(self, image, cvt_type='RGB')

Source from the content-addressed store, hash-verified

13 self.seq_len = seq_len
14
15 def _pillow_convert(self, image, cvt_type='RGB'):
16 if image.mode != cvt_type:
17 if image.mode == 'P':
18 image = image.convert(f'{cvt_type}A')
19 if image.mode == f'{cvt_type}A':
20 bg = Image.new(
21 cvt_type,
22 size=(image.width, image.height),
23 color=(255, 255, 255))
24 bg.paste(image, (0, 0), mask=image)
25 image = bg
26 else:
27 image = image.convert(cvt_type)
28 return image
29
30 def _load_image(self, img_path):
31 if img_path is None or img_path == '':

Callers 1

_load_imageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected