1.新增视觉能力 2.新增对上次图片 或 上传图片 引用图片做编辑能力.
This commit is contained in:
@@ -90,10 +90,20 @@ def create_edit_furniture_tool(workspace_dir, width: int = 1024, height: int = 1
|
||||
logger.info(f"\n[系统日志] 正在调用 edit_furniture ...")
|
||||
thread_id = runtime.config.get("configurable").get("thread_id")
|
||||
try:
|
||||
current_image_path = image_store.get_image_path(thread_id).get("current_image_path", False)
|
||||
input_image_path = runtime.state.get("files").get("input_image", False)
|
||||
if input_image_path or current_image_path:
|
||||
input_path = [path for path in (input_image_path, current_image_path) if path]
|
||||
current_image_path = None
|
||||
if image_store.get_image_path(thread_id):
|
||||
current_image_path = image_store.get_image_path(thread_id).get("current_image_path", False)
|
||||
user_input_image_paths = runtime.state.get("files").get("input_image", [])
|
||||
user_quote_image_path = runtime.state.get("files").get("quote_image", "")
|
||||
input_path = []
|
||||
if len(user_input_image_paths) or current_image_path:
|
||||
if len(user_input_image_paths):
|
||||
for path in user_input_image_paths:
|
||||
input_path.append(path)
|
||||
if user_quote_image_path:
|
||||
input_path.append(user_quote_image_path)
|
||||
if not len(user_input_image_paths) and not user_quote_image_path:
|
||||
input_path = [current_image_path]
|
||||
object_name = f"furniture/sketches/{uuid.uuid4()}.png"
|
||||
bucket_name = "fida-test" # 替换为你的 bucket 名称
|
||||
request_data = {
|
||||
|
||||
Reference in New Issue
Block a user