zf-kbot/md-me-sam3

Public
17.6K runs

Run zf-kbot/md-me-sam3 with an API

Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.

Input schema

The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.

Field Type Default value Description
image
string
输入图像
prompt_type
None
auto
交互类型:point(L1单击/L3点精修) / box(框选) / text(L2文字批量) / exemplar(L4相似查找) / auto(L0自动主体)
points
string
点坐标 JSON:[[x,y,label],...],label 1=前景 0=背景。例:[[512,300,1],[220,110,0]]
boxes
string
框坐标 JSON:[[x1,y1,x2,y2],...]。box 取第一个;exemplar 用作示例框。
text_prompt
string
文字 prompt(名词短语),用于 text 模式开放词汇分割,如 "person" / "red car"
multimask
boolean
True
point 模式是否返回 Top-3 候选(局部/对象/整体)
use_cache
boolean
True
复用该图 Embedding 缓存(同图精修/换 prompt 时强烈建议开启)
max_instances
integer
50

Min: 1

Max: 300

返回实例上限(text/exemplar 多实例时截断)
output_format
None
rle
蒙版导出格式:rle(紧凑,默认) / svg(矢量路径) / both
feather
integer
0

Max: 50

边缘羽化强度(像素),0=不羽化
fill_holes
boolean
False
填补蒙版内部孔洞
despeckle
integer
0
移除小于该面积(像素)的碎块,0=不处理
include_preview
boolean
True
输出合成预览 PNG

Output schema

The shape of the response you’ll get when you run this model with an API.

Schema
{
  "type": "object",
  "title": "Output",
  "required": [
    "masks_json",
    "num_instances",
    "cache_hit",
    "gpu_ms",
    "latency_ms"
  ],
  "properties": {
    "gpu_ms": {
      "type": "number",
      "title": "Gpu Ms"
    },
    "cache_hit": {
      "type": "boolean",
      "title": "Cache Hit"
    },
    "latency_ms": {
      "type": "number",
      "title": "Latency Ms"
    },
    "masks_json": {
      "type": "string",
      "title": "Masks Json"
    },
    "combined_mask": {
      "type": "string",
      "title": "Combined Mask",
      "format": "uri",
      "nullable": true
    },
    "num_instances": {
      "type": "integer",
      "title": "Num Instances"
    }
  }
}