alicloud-ai-image-qwen-image-edit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCategory: provider
分类:服务商
Model Studio Qwen Image Edit
Model Studio Qwen 图像编辑
Use Qwen Image Edit models for instruction-based image editing instead of text-to-image generation.
使用Qwen Image Edit模型进行基于指令的图像编辑,而非文本生成图像。
Critical model names
关键模型名称
Use one of these exact model strings:
qwen-image-edit-maxqwen-image-edit-max-2026-01-16
请使用以下精确模型字符串之一:
qwen-image-edit-maxqwen-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中添加~/.alibabacloud/credentials。dashscope_api_key
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
- (字符串):生成后图片的URL
image_url - (整数):使用的随机种子
seed - (字符串):请求ID
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/alicloud-ai-image-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/alicloud-ai-image-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/ai-image-qwen-image-edit/images/ - Override base dir with .
OUTPUT_DIR
- 默认输出路径:
output/ai-image-qwen-image-edit/images/ - 可通过覆盖基础目录。
OUTPUT_DIR
References
参考资料
references/sources.md
references/sources.md