glucauze / sd-webui-faceswaplab

Extended faceswap extension for StableDiffusion web-ui with multiple faceswaps, inpainting, checkpoints, ....
https://glucauze.github.io/sd-webui-faceswaplab/
GNU Affero General Public License v3.0
748 stars 100 forks source link

How to use batch_images in FaceSwapUnit #159

Open jiyoon0630 opened 10 months ago

jiyoon0630 commented 10 months ago

Hi.

I was following faceswaplab_api_exambple.py and I'd like to ask how to use batch_images in FaceSwapUnit.

In api_utils.py, batch_images means "list of base64 batch source images" which can be used for blending multiple user images.

However, if I set batch_images as a list of base64 images, then validation error comes like below.

unit1 = FaceSwapUnit(
    source_img=pil_to_base64("user1.png"),  
    batch_images=[pil_to_base64('user1.png'), pil_to_base64('user2.png')]
)

ValidationError: 1 validation error for FaceSwapUnit batch_images wrong tuple length 2, expected 1 (type=value_error.tuple.length; actual_length=2; expected_length=1)

I've check that the error comes from Tuple[str]. So I tried to change it to Tuple[str, ... ] or List[str], but it causes same error while requesting.

{'detail': [{'loc': ['body', 'units', 0, 'batch_images'], 'msg': 'wrong tuple length 2, expected 1', 'type': 'value_error.tuple.length', 'ctx': {'actual_length': 2, 'expected_length': 1}}]}

Can you explain how to use batch_images?

ChenCheng2Cs commented 9 months ago

Did you solve it?