Merge pull request #2729 from Trojaner/api/ipadapters

Fix FaceID API not working because of wrong rank type
This commit is contained in:
Vladimir Mandic
2024-01-16 19:34:52 -05:00
committed by GitHub
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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?")
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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}'