Sam模型加载器(细节修复节点束)
节点功能:该节点作为细节修复流程中的分割组件,与 SAM (Segment Anything Model) 相关,用于图像分割任务。SAMLoader (Pipe)-
节点中英文对比
Sam模型加载器(细节修复节点束)
model_name
device_mode
sam_detection_hint
sam_dilation
sam_threshold
sam_bbox_expansion
sam_mask_hint_threshold
sam_mask_hint_use_negative
SAMLoader (Pipe)
model_name
device_mode
sam_detection_hint
sam_dilation
sam_threshold
sam_bbox_expansion
sam_mask_hint_threshold
sam_mask_hint_use_negative
Sam模型加载器(细节修复节点束) - 参数说明
输出参数
sam_pipe
包含已加载 SAM 模型及其分割参数的管线结构,供后续 DetailerFix 使用。
控件参数
model_name
选择用于分割的 SAM 模型名称,模型需位于 sams 文件夹中。
device_mode
指定模型推理设备模式。可选值:AUTO、Prefer GPU、CPU。
sam_detection_hint
SAM 模型的检测提示方式,用于引导 mask 推理。
center-1:中心点引导单目标;
- horizontal-2:水平双目标;
- vertical-2:垂直双目标;
- rect-4:矩形四点;
- diamond-4:菱形四点;
- mask-area:根据已有掩码面积计算;
- mask-points:从掩码中采样正负点;
- mask-point-bbox:mask 周边框引导;
- none:无提示,直接使用原始 mask。推荐根据具体任务选择。
sam_dilation
对 SAM 生成的掩码进行扩张或腐蚀操作(负值为腐蚀)。控制分割区域边界,默认 0。大于 0 可扩大掩码,负值用于收缩边缘。
sam_threshold
SAM mask 的置信度阈值,取值范围为 0~1。默认 0.93,表示仅保留高置信度区域。适当降低可提升召回率,但风险是引入伪掩码。
sam_bbox_expansion
在 bbox 基础上进行额外扩张像素,增强覆盖范围。
sam_mask_hint_threshold
引导提示点的置信度阈值,控制 hint mask 生成。
sam_mask_hint_use_negative
是否使用负提示点辅助 mask 引导。
False:不使用负提示。
Small:使用 mask 中的小区域作为负样本。
Outter:使用外围区域作为负样本。推荐 Small 提升精度。
暂无节点说明