add sam_hq

This commit is contained in:
Qing
2024-02-20 09:03:11 +08:00
parent 6447e821cb
commit b358e6cbce
10 changed files with 1281 additions and 19 deletions

View File

@@ -146,6 +146,9 @@ class InteractiveSegModel(Choices):
vit_b = "vit_b"
vit_l = "vit_l"
vit_h = "vit_h"
sam_hq_vit_b = "sam_hq_vit_b"
sam_hq_vit_l = "sam_hq_vit_l"
sam_hq_vit_h = "sam_hq_vit_h"
mobile_sam = "mobile_sam"
@@ -394,6 +397,15 @@ class InpaintRequest(BaseModel):
return 0
return v
@field_validator("sd_strength")
@classmethod
def validate_sd_strength(cls, v: float, values):
use_extender = values.data["use_extender"]
if use_extender:
logger.info(f"Extender is enabled, set sd_strength=1")
return 1.0
return v
class RunPluginRequest(BaseModel):
name: str