Overview
YesExisting videoPerform content element replacement (people/scenes/clothing/garments/outfits), preserving the original camera movement and actions, covering 2 types of scenarios:
- Text instruction replacement: Text instructions drive video content modification, no additional reference image needed.
- Reference-image driven replacement: The user provides a reference image + video, and the corresponding elements in the video are replaced according to the reference image.
Not handled: video generation, watermark/subtitle removal, overall style transformation, audio modification, video splicing.
API Mapping
| Scenario | API name | model |
|---|---|---|
| Text instruction replacement | video_molasses_edit |
molasses |
| Reference-image driven replacement | video_molasses_vidimgs2vid |
molasses |
model Optional:auto(default, automatically routed based on whether a reference image exists) / molasses(explicitly specified).
Dependencies
- meitu-cli:
>=2.0.6 - Credentials:CONFIG AKSK →
meitu tools update; EXEC AKSK → run command - Environment variables:
MEITU_OPENAPI_TOOL_TASK_MODE=command
Path alias:
$VISUAL={OPENCLAW_HOME}/workspace/visual/
Core Workflow
Preflight → Execute → Deliver
Preflight
meitu --versionandmeitu auth verify --json- Detect
MEITU_OPENAPI_TOOL_TASK_MODE=command - output_dir: project →
./output/; one-time →$VISUAL/output/video-content-replace/;mkdir -p
Execute
Trigger signals and routing
Core judgment dimension:whether a reference image is provided。
| Scenario | Judgment | Routing |
|---|---|---|
| Has reference image + replace element | Has image_url |
video_molasses_vidimgs2vid |
| No reference image + text instruction | No image_url |
video_molasses_edit(default) |
Routing principle:image_url When it exists, prioritize the reference-image mode, even if the user says "modify using a text description", still use vidimgs2vid。
Parameter definitions
| Parameter | Type | Required | Range | Default | Description |
|---|---|---|---|---|---|
video_url |
STRING | Yes | See constraints below | — | Original video address |
prompt |
STRING | Yes | — | — | Modification description |
image_url |
STRING | No | — | — | Reference image URL; when present, route to vidimgs2vid |
model |
STRING | No | auto/molasses |
auto |
Model selection |
The remaining parameters (duration/ratio/character_orientation etc.) are managed internally by combo-tool and are not exposed externally.
video_url Constraints (dedicated to reference-image driven mode):
- Format:
.mp4/.mov; size: ≤ 100MB - Side length: 340px ~ 3850px; duration: 3 ~ 30 seconds
- Image: clearly show the upper body/full body, 1 person action, one continuous shot, stable movement
video_molasses_edit(Text instruction mode) The restrictions on video_url are relatively loose, mainly format and size.
Tool invocation
# 文本指令
meitu video-content-replace --video_url {url} --prompt "{修改描述}" --json --download-dir {output_dir} --skill_name skill_video-content-replace
# 参考图驱动
meitu video-content-replace --video_url {url} --prompt "{修改描述}" --image_url {ref} --json --download-dir {output_dir} --skill_name skill_video-content-replace
Error fallback
| Scenario | Handling |
|---|---|
video_url Missing |
Prompt "Please provide a video link", do not invoke |
video_url Inaccessible |
Return the error directly, do not retry |
prompt Missing |
Prompt "Please describe the content you want to modify" |
image_url Inaccessible |
Fall back to video_molasses_edit(prompt only) |
video_url not mp4/mov |
Prompt for format requirements, do not call |
video_url >100MB or edge length out of bounds |
Prompt for the specific exceeded item |
video_url duration <3s / >30s (vidimgs2vid) |
Prompt for duration requirements |
| Return "Video duration can not longer than" | Identify as reference video duration exceeding the limit (not generation duration), prompt the user to trim the video rather than retry |
| API call failed / timed out | Retry once; if still failing, return an error |
| Content compliance interception | Directly return a compliance prompt, do not retry |
Deliver
mv {file} {output_dir}/{date}_{name}_content-replace.mp4
Output
- Format:MP4
- Naming:
{YYYY-MM-DD}_{descriptive-name}_content-replace.mp4 - Location: Project →
./output/; One-time →$VISUAL/output/video-content-replace/
Baseline Task ID
t_mt1a3i5n7b82954cc9-d2cb-44cd-a786-cb9fd37244f9