aliyun-qwen-image-edit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCategory: provider
分类:provider
Model Studio Qwen Image Edit
Model Studio Qwen 图像编辑
Validation
验证
bash
mkdir -p output/aliyun-qwen-image-edit
python -m py_compile skills/ai/image/aliyun-qwen-image-edit/scripts/prepare_edit_request.py && echo "py_compile_ok" > output/aliyun-qwen-image-edit/validate.txtPass criteria: command exits 0 and is generated.
output/aliyun-qwen-image-edit/validate.txtbash
mkdir -p output/aliyun-qwen-image-edit
python -m py_compile skills/ai/image/aliyun-qwen-image-edit/scripts/prepare_edit_request.py && echo "py_compile_ok" > output/aliyun-qwen-image-edit/validate.txt通过标准:命令退出码为0,且生成文件。
output/aliyun-qwen-image-edit/validate.txtOutput And Evidence
输出与凭证
- Save edit request payloads, result URLs, and model parameters under .
output/aliyun-qwen-image-edit/ - Keep one sample request/response pair for reproducibility.
Use Qwen Image Edit models for instruction-based image editing instead of text-to-image generation.
- 将编辑请求载荷、结果URL和模型参数保存在目录下。
output/aliyun-qwen-image-edit/ - 留存一组请求/响应样本用于复现。
请使用Qwen图像编辑模型完成指令驱动的图像编辑任务,而非文生图生成。
Critical model names
核心模型名称
Use one of these exact model strings:
qwen-image-editqwen-image-edit-plusqwen-image-edit-maxqwen-image-2.0qwen-image-2.0-proqwen-image-2.0-2026-03-03qwen-image-2.0-pro-2026-03-03qwen-image-edit-plus-2025-12-15qwen-image-edit-max-2026-01-16
请使用以下准确的模型字符串之一:
qwen-image-editqwen-image-edit-plusqwen-image-edit-maxqwen-image-2.0qwen-image-2.0-proqwen-image-2.0-2026-03-03qwen-image-2.0-pro-2026-03-03qwen-image-edit-plus-2025-12-15qwen-image-edit-max-2026-01-16
Prerequisites
前置条件
- Install SDK in a virtual environment:
bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope- Set in your environment, or add
DASHSCOPE_API_KEYtodashscope_api_key.~/.alibabacloud/credentials
- 在虚拟环境中安装SDK:
bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope- 在环境变量中设置,或者将
DASHSCOPE_API_KEY添加到dashscope_api_key文件中。~/.alibabacloud/credentials
Normalized interface (image.edit)
标准化接口(image.edit)
Request
请求参数
- (string, required)
prompt - (string | bytes, required) source image URL/path/bytes
image - (string | bytes, optional) inpaint region mask
mask - (string, optional) e.g.
size1024*1024 - (int, optional)
seed
- (字符串,必填)
prompt - (字符串 | 字节流,必填)源图像URL/路径/字节流
image - (字符串 | 字节流,可选)图像修复区域掩码
mask - (字符串,可选)例如
size1024*1024 - (整数,可选)
seed
Response
返回参数
- (string)
image_url - (int)
seed - (string)
request_id
- (字符串)
image_url - (整数)
seed - (字符串)
request_id
Operational guidance
操作指引
- Keep prompts task-oriented: describe what to change and what to preserve.
- Use masks for deterministic local edits.
- Save output assets to object storage and persist only URLs.
- For subject consistency, provide explicit constraints in prompt.
- 提示词需面向任务:明确描述需要修改的内容和需要保留的内容。
- 进行确定性局部编辑时使用掩码。
- 将输出资源保存到对象存储中,仅持久化存储URL。
- 如需保持主体一致性,请在提示词中添加明确约束。
Local helper script
本地辅助脚本
Prepare a normalized request JSON and validate response schema:
bash
.venv/bin/python skills/ai/image/aliyun-qwen-image-edit/scripts/prepare_edit_request.py \
--prompt "Replace the sky with sunset, keep buildings unchanged" \
--image "https://example.com/input.png"生成标准化请求JSON并验证响应格式:
bash
.venv/bin/python skills/ai/image/aliyun-qwen-image-edit/scripts/prepare_edit_request.py \
--prompt "Replace the sky with sunset, keep buildings unchanged" \
--image "https://example.com/input.png"Output location
输出路径
- Default output:
output/aliyun-qwen-image-edit/images/ - Override base dir with .
OUTPUT_DIR
- 默认输出路径:
output/aliyun-qwen-image-edit/images/ - 可通过环境变量覆盖基础目录。
OUTPUT_DIR
Workflow
工作流程
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
- 确认用户意图、区域、标识,以及操作是只读还是修改性质。
- 先运行一个最简只读查询验证连通性和权限。
- 使用明确参数和有限范围执行目标操作。
- 验证结果并保存输出/凭证文件。
References
参考文档
references/sources.md
references/sources.md