SuperAPI AI Directory

image-portrait-generate

Design & creation

View repository

Updated 10-16 09:34

About this skill

Image Portrait Generate

Overview

Generate high-precision portraits from reference images (human portraits/pets), covering single-person/pet/multi-person portraits (ID photos/profile photos/artistic photos/hairstyle adjustment/scene changes) and two-person composite photo synthesis. Supports 2K/4K resolution. Triggered only when the user explicitly requests portrait generation or two-person composite photo synthesis; not for generalized "group photo" or "team photo" chit-chat scenarios.

API Mapping

  • Single-person/pet/multi-person portraits (primary):image_gummy_edit_v45
  • Single-person/pet portrait fallback (last resort):image_mint_portrait_edit_2k
  • Two-person composite photo synthesis:image_groupphoto2_edit
  • model mapping:auto(default)/gummy_pro→v45 / mint_portrait→mint_2k

Dependencies

  • meitu-cli: >=2.0.6
  • 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
  2. Already ran with CONFIG AKSK meitu tools update
  3. current AKSK = EXEC,MEITU_OPENAPI_TOOL_TASK_MODE=command
  4. output_dir:openclaw.yaml → ./output/ |else → $VISUAL/output/image-portrait-generate/;mkdir -p

Execute

trigger signals / routing rules

core dimensions:number of input images + group photo signal。

scenario determination keywords number of images routing
two-person composite photo group photo, composite photo, two people composite exactly 2 image_groupphoto2_edit
two-person composite photo but fewer than 2 images group photo 1 prompt "please provide two portrait photos"
two-person composite photo but more than 2 images group photo >2 take the first 2 images + inform
single-person / pet portrait portrait, ID photo, profile photo, hairstyle, pet portrait 1 or >1 image_gummy_edit_v45 → image_mint_portrait_edit_2k
multi-person portrait (3+ people) team photo, 3-person portrait 1 (multi-person image) image_gummy_edit_v45(no fallback)
unclear intent + 2 images -- 2 default to single-person portrait

parameter definitions

parameter type required range default description
image_list ARRAY[STRING] yes 1–N images -- array of portrait/pet image URLs
prompt STRING yes -- -- portrait description; automatically generated from context when missing
size STRING no 2K / 4K 2K output resolution (only image_gummy_edit_v45 supported)

API mapping description:

  • image_gummy_edit_v45(primary):image_list[0]→image_url(the API itself supports multiple people),prompt/size direct pass
  • image_mint_portrait_edit_2k(fallback):image_list[0]→image_url,prompt direct pass
  • image_groupphoto2_edit(two-person composite photo):image_list array (must be exactly 2),prompt→instruction(non-Chinese/English automatically translated to Chinese); fixed parameter lora_key=multi_duorenhezhao_2k、rsp_media_type=url

ID photo + specified background color (blue/white/red): write the background color requirement into prompt (e.g., "blue solid background ID photo").

tool invocation

meitu image-portrait-generate --image_list <img1>[,<img2>,...] --prompt "<desc>" [--size 2K|4K] --json --download-dir {output_dir} --skill_name skill_image-portrait-generate

error fallback

scenario handling method
image_list missing prompt "please provide a reference image", do not call API
image_list any image in is inaccessible Return an invalid image link error, do not retry
prompt missing Automatically generated based on context
Group photo but only 1 image Prompt "Please provide two portrait photos"
Group photo and >2 images Take the first 2 images and notify
Portrait but 2 images provided Default to single-person portrait
image_gummy_edit_v45 failed (single person/pet) Automatically downgrade to image_mint_portrait_edit_2k
image_mint_portrait_edit_2k failed Return error
image_gummy_edit_v45 failed (multiple people/3+ people) Do not downgrade, return error directly
image_groupphoto2_edit failed Return error
No face/pet detected Return error: reference image must contain a clear portrait or pet
Content compliance interception Return compliance prompt directly, do not retry, do not downgrade

Deliver

  • Use the output_dir parsed by Preflight
  • From downloaded_files[0].saved_path read the downloaded file path
  • mv {downloaded_files[0].saved_path} {output_dir}/{YYYY-MM-DD}_{descriptive}_image-portrait-generate.{ext}

Output

  • Format:image
  • Location: project → ./output/, one-time → $VISUAL/output/image-portrait-generate/

Baseline Task ID

See references/task-id-baseline.md corresponding row in.