add remove_background tool

This commit is contained in:
jingrow 2025-11-21 21:30:25 +08:00
parent 47517a1e55
commit 7b150fc3b2
3 changed files with 3 additions and 8 deletions

View File

@ -93,7 +93,7 @@ const router = createRouter({
{ {
path: 'tools/remove-background', path: 'tools/remove-background',
name: 'RemoveBackground', name: 'RemoveBackground',
component: () => import('../../views/tools/RemoveBackground.vue') component: () => import('../../views/tools/remove_background/remove_background.vue')
}, },
{ {
path: 'search', path: 'search',

View File

@ -408,7 +408,7 @@ const handleRemoveBackground = async () => {
const base64Data = await base64Promise const base64Data = await base64Promise
const response = await axios.post( const response = await axios.post(
'/jingrow.tools.tools.remove_background', '/jingrow.tools.remove_background.remove_background.remove_background_from_file',
{ {
image_data: base64Data image_data: base64Data
}, },

View File

@ -1,11 +1,6 @@
# Copyright (c) 2025, JINGROW and contributors # Copyright (c) 2025, JINGROW and contributors
# For license information, please see license.txt # For license information, please see license.txt
"""
Jingrow Tools API
提供各种工具服务的API端点
"""
import base64 import base64
import requests import requests
from typing import Dict, Any, Union from typing import Dict, Any, Union
@ -18,7 +13,7 @@ logger = logging.getLogger(__name__)
@jingrow.whitelist() @jingrow.whitelist()
def remove_background(image_data: Union[str, list]) -> Dict[str, Any]: def remove_background_from_file(image_data: Union[str, list]) -> Dict[str, Any]:
""" """
图片去背景工具 图片去背景工具
调用 Jingrow Cloud API 实现图片背景移除 调用 Jingrow Cloud API 实现图片背景移除