SuperAPI AI Directory

image-grid-split

Design & creation

View repository

Updated 10-16 09:32

About this skill

Image splitting (image-grid-split)

Overview

Automatically detect grid split lines and split a single multi-cell image into multiple independent images. Covers automatic splitting of standard grids such as four-grid/nine-grid/six-grid, automatically detecting split line positions; used for separating e-commerce multi-image composite images and restoring social media grid images. Only requires image_url, no need to specify the number of grids.

Before execution, the user should clearly know: this Skill will read Meitu credentials, call the local meitu CLI, send the user-provided image URL to the Meitu OpenAPI for processing, and write the split results to ./output/ or $VISUAL/output/image-grid-split/。

API Mapping

  • Grid splitting:image_grid_split

Dependencies

  • meitu-cli: >=2.0.6(npm install -g meitu-cli@latest)
  • Credentials:CONFIG AKSK → meitu tools update; EXEC AKSK → actual execution (see root CONFIG.md)
  • Environment variables:MEITU_OPENAPI_TOOL_TASK_MODE=command

Path alias:$VISUAL = {OPENCLAW_HOME}/workspace/visual/

Core Workflow

Preflight → Execute → Deliver

Preflight

  1. meitu --version ≥ 2.0.6 (otherwise npm install -g meitu-cli@latest)
  2. Confirm that meitu tools updatehas been run (using CONFIG AKSK)
  3. Current AKSK = EXEC, and MEITU_OPENAPI_TOOL_TASK_MODE=command
  4. Resolve output_dir: openclaw.yaml → ./output/ |else → $VISUAL/output/image-grid-split/;mkdir -p

Execute

Trigger signals / routing rules

Scenario Determination keywords Routing
Grid image splitting four-grid, nine-grid, cut into multiple, split puzzle apart, grid image image_grid_split

Decision order:

  1. image_url missing → follow up
  2. Unique route: call image_grid_split, automatically detect split lines (no need for the user to specify the number of grids)

Single API tool: call when parameters are complete; after a failure, retry once and then return an error; no cross-tool fallback. For non-grid images / when no split lines are detected, process by equal division and inform the user.

Parameter definitions

Parameter Type Required Range Default value Description
image_url STRING Yes -- -- Image address (must be a grid image). If missing → prompt "Please provide the grid image to be split"

Tool invocation

meitu image-grid-split \
  --skill_name skill_image-grid-split \
  --image_url <image_url> \
  --json \
  --download-dir {output_dir}

Error degradation

Scenario Handling method
image_url missing Prompt "Please provide the grid image to be split"
image_url inaccessible Directly return an invalid image link error, no retry
Non-grid image Call normally (cut by equal division), inform the user that the result may not be ideal
No split lines detected Process by equal division
image_grid_split call failed Retry once; if still failing, return an error
Content compliance interception Return a compliance prompt, no retry
User wants to crop a certain area This tool only supports splitting grid images, not cropping
User wants to combine Opposite direction; this tool only splits, does not combine

Deliver

  • Directly use the output_dir resolved by Preflight
  • From downloaded_files[*].saved_path read all downloaded file paths
  • Rename in order to {YYYY-MM-DD}_{descriptive}_image-grid-split_{idx}.jpg(multiple outputs increment by idx)

Output

  • Format: JPEG/PNG (keep the original format, multiple independent images)
  • Naming:{YYYY-MM-DD}_{descriptive}_image-grid-split_{idx}.jpg
  • Location: Project → ./output/, one-time → $VISUAL/output/image-grid-split/

Baseline Task ID

See references/task-id-baseline.md for the corresponding line.