This commit is contained in:
2026-05-14 18:37:18 +08:00
parent 5e6d8046e1
commit 7a2ffc91a2
15 changed files with 200 additions and 56 deletions
+16 -7
View File
@@ -86,10 +86,17 @@ class InpaintModelInfo(TypedDict):
family: str
name: str
description: str
backend: str # "sdxl_inpaint" | "controlnet"
backend: str # "flux_fill" | "sdxl_inpaint" | "controlnet"
INPAINT_MODELS: List[InpaintModelInfo] = [
{
"id": "flux_fill",
"family": "FLUX",
"name": "FLUX.1 Fill",
"description": "FLUX Fill 专用补全",
"backend": "flux_fill",
},
{
"id": "sdxl_inpaint",
"family": "SDXL",
@@ -100,8 +107,8 @@ INPAINT_MODELS: List[InpaintModelInfo] = [
{
"id": "controlnet",
"family": "ControlNet",
"name": "ControlNet (placeholder)",
"description": "ControlNet 补全/控制生成(当前统一封装暂未实现)",
"name": "SD1.5 + ControlNet Inpaint",
"description": "runway inpaint + v11p inpaint ControlNet",
"backend": "controlnet",
},
]
@@ -159,10 +166,12 @@ class DepthConfig:
@dataclass
class InpaintConfig:
# 统一补全默认后端
backend: Literal["sdxl_inpaint", "controlnet"] = "sdxl_inpaint"
# SDXL Inpaint 的基础模型(可写 HuggingFace model id 或本地目录
sdxl_base_model: str = "stabilityai/stable-diffusion-xl-base-1.0"
# 统一补全默认后端(与 model key 对齐;实际路由以请求的 model_name 为准)
backend: Literal["flux_fill", "sdxl_inpaint", "controlnet"] = "flux_fill"
# FLUX Fillgated:须在 Hugging Face 同意条款,并建议设置环境变量 HF_TOKEN
flux_fill_model: str = "black-forest-labs/FLUX.1-Fill-dev"
# SDXL:须为专用 inpaint 权重(勿用 xl-base 当补全底模)
sdxl_base_model: str = "diffusers/stable-diffusion-xl-1.0-inpainting-0.1"
# ControlNet Inpaint 基础模型与 controlnet 权重
controlnet_base_model: str = "runwayml/stable-diffusion-inpainting"
controlnet_model: str = "lllyasviel/control_v11p_sd15_inpaint"