diff --git a/modules/api/api.py b/modules/api/api.py index 6ecaebce1..979774d13 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -264,7 +264,16 @@ class Api: def prepare_img_gen_request(self, request, img_gen_type: str): if hasattr(request, "face_id") and request.face_id and not request.script_name and (not request.alwayson_scripts or "FaceID" not in request.alwayson_scripts.keys()): request.script_name = "FaceID" - request.script_args = [request.face_id.scale, request.face_id.image] + request.script_args = [ + request.face_id.model, + request.face_id.scale, + request.face_id.image, + request.face_id.override_sampler, + request.face_id.rank, + request.face_id.tokens, + request.face_id.structure, + request.face_id.cache_model + ] del request.face_id if hasattr(request, "ip_adapter") and request.ip_adapter and request.script_name != "IP Adapter" and (not request.alwayson_scripts or "IP Adapter" not in request.alwayson_scripts.keys()): @@ -284,7 +293,7 @@ class Api: for script_name in request.alwayson_scripts.keys(): script_obj = request.alwayson_scripts[script_name] - if "args" in script_obj and script_obj["args"]: + if script_obj and "args" in script_obj and script_obj["args"]: self.sanitize_args(script_obj["args"]) if hasattr(request, "script_args") and request.script_args: diff --git a/modules/api/models.py b/modules/api/models.py index 0cd38fddc..520e061f7 100644 --- a/modules/api/models.py +++ b/modules/api/models.py @@ -99,8 +99,14 @@ class IPAdapterItem(BaseModel): class FaceIDItem(BaseModel): + model: str = Field(title="Model", default="FaceID Base",description="The FaceID model to use.") 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=0.5, gt=0, le=1, description="Scale of the source face, must be between 0 and 1.") + scale: float = Field(title="Scale", default=1, gt=0, le=1, description="Scale of the source face, must be between 0 and 1.") + structure: float = Field(title="Structure", default=1, gt=0, le=1, description="Structure to use, must be between 0 and 1.") + rank: float = 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("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?") StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(