linkfox-ai-web-sdk
v0.0.25
Published
```js npm install linkfox-ai-web-sdk # or yarn add linkfox-ai-web-sdk ```
Readme
安装
npm install linkfox-ai-web-sdk
# or
yarn add linkfox-ai-web-sdk使用方式
import { ImageEditor, Matting } from 'linkfox-ai-web-sdk';
// 抠图组件
<Matting
open={open}
types={['human_body','cloth','goods','face']}
originImgUrl='' // 图片地址
onMatting={() => { }} // 抠图结果回调
onCancel={() => setOpen(false)} // 关闭回调
drawApis={{ // 依赖的作图 api 接口,下文会有详细介绍
getUploadUrl: () => { },
getCutoutOriginImageUrl: () => { },
autoCutout: () => { },
getAutoCutoutResult: () => { },
interactCutout: () => { },
interactErase: () => { },
getPostureList: () => { },
getPostureInfo: () => { },
}}
/>
// 原图编辑器组件
<ImageEditor
open={open}
originUrl='' // 原图地址
matting={{ // 抠图相关数据
url: '', // 原图对应的抠图结果图地址
types={['human_body','cloth','goods','face']}
}}
onSuccess={() => {}} // 保存确认后回调
onClose={() => { }} // 关闭回调
drawApis={{ // 依赖的作图 api 接口,下文会有详细介绍
getUploadUrl: () => { },
getCutoutOriginImageUrl: () => { },
autoCutout: () => { },
getAutoCutoutResult: () => { },
interactCutout: () => { },
interactErase: () => { },
getPostureList: () => { },
getPostureInfo: () => { },
}}