diff --git a/modules/api/models.py b/modules/api/models.py index 22b77cbea..dca498473 100644 --- a/modules/api/models.py +++ b/modules/api/models.py @@ -104,7 +104,7 @@ class FaceIDItem(BaseModel): image: str = Field(title="Image", default="", description="Source face image, must be a base64 string containing the image's data.") scale: float = Field(title="Scale", default=1, ge=0, le=2, description="Scale of the source face, must be between 0.0 and 2.0.") structure: float = Field(title="Structure", default=1, ge=0, le=1, description="Structure to use, must be between 0.0 and 1.0.") - rank: float = Field(title="Rank", default=128, ge=4, le=256, description="Rank to use, must be between 4 and 256.") + rank: int = Field(title="Rank", default=128, ge=4, le=256, description="Rank to use, must be between 4 and 256.") override_sampler: bool = Field(title="Override Sampler", default=True, description="Should the sampler be overriden?") tokens: int = Field(title="Tokens", default=4, ge=1, le=16, description="Amount of tokens to use, must be between 1 and 16.") cache_model: bool = Field(title="Cache", default=True, description="Should the model be cached?") diff --git a/scripts/faceid.py b/scripts/faceid.py index 807e0096d..6d07a9406 100644 --- a/scripts/faceid.py +++ b/scripts/faceid.py @@ -218,7 +218,7 @@ class Script(scripts.Script): if isinstance(image, str): from modules.api.api import decode_base64_to_image - image = decode_base64_to_image(image) + image = decode_base64_to_image(image).convert("RGB") np_image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR) faces = app.get(np_image) diff --git a/scripts/ipadapter.py b/scripts/ipadapter.py index fb9dc463c..fe40ca87e 100644 --- a/scripts/ipadapter.py +++ b/scripts/ipadapter.py @@ -128,7 +128,7 @@ def apply(pipe, p: processing.StableDiffusionProcessing, adapter_name, scale, im if isinstance(image, str): from modules.api.api import decode_base64_to_image - image = decode_base64_to_image(image) + image = decode_base64_to_image(image).convert("RGB") p.task_args['ip_adapter_image'] = p.batch_size * [image] p.extra_generation_params["IP Adapter"] = f'{adapter}:{scale}'