通义万相-图像编辑模型(wan2.5)支持多图输入(1-3张)和多图输出(1-4张),通过文本指令实现主体一致的单图编辑、目标检测与分割以及多图融合等能力。
快速开始
前提条件
在调用前,先获取API Key,再配置API Key到环境变量。如需通过SDK进行调用,请安装DashScope SDK。
示例代码
本示例以多图融合为例:在images数组中传入2张图像,模型将根据文本提示词输出 1 张融合后的图像。
提示词:将图1中的闹钟放置到图2的餐桌的花瓶旁边位置。
输入图像1 | 输入图像2 | 输出图像 |
|
|
|
同步调用
推荐安装最新版DashScope SDK,否则可能运行报错:安装或升级SDK。
Python
本示例支持三种图像输入方式:公网URL、Base64编码、本地文件路径。
请求示例
import base64
import mimetypes
from http import HTTPStatus
from urllib.parse import urlparse, unquote
from pathlib import PurePosixPath
import dashscope
import requests
from dashscope import ImageSynthesis
import os
# 以下为北京地域url,若使用新加坡地域的模型,需将url替换为:https://dashscope-intl.aliyuncs.com/api/v1
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
# 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
# 新加坡和北京地域的API Key不同。获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
# --- 输入图片:使用 Base64 编码 ---
# base64编码格式为 data:{MIME_type};base64,{base64_data}
def encode_file(file_path):
mime_type, _ = mimetypes.guess_type(file_path)
if not mime_type or not mime_type.startswith("image/"):
raise ValueError("不支持或无法识别的图像格式")
with open(file_path, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
return f"data:{mime_type};base64,{encoded_string}"
"""
图像输入方式说明:
以下提供了三种图片输入方式,三选一即可
1. 使用公网URL - 适合已有公开可访问的图片
2. 使用本地文件 - 适合本地开发测试
3. 使用Base64编码 - 适合私有图片或需要加密传输的场景
"""
# 【方式一】使用公网图片 URL
image_url_1 = "https://img.alicdn.com/imgextra/i3/O1CN0157XGE51l6iL9441yX_!!6000000004770-49-tps-1104-1472.webp"
image_url_2 = "https://img.alicdn.com/imgextra/i3/O1CN01SfG4J41UYn9WNt4X1_!!6000000002530-49-tps-1696-960.webp"
# 【方式二】使用本地文件(支持绝对路径和相对路径)
# 格式要求:file:// + 文件路径
# 示例(绝对路径):
# image_url_1 = "file://" + "/path/to/your/image_1.png" # Linux/macOS
# image_url_2 = "file://" + "C:/path/to/your/image_2.png" # Windows
# 示例(相对路径):
# image_url_1 = "file://" + "./image_1.png" # 以实际路径为准
# image_url_2 = "file://" + "./image_1.png" # 以实际路径为准
# 【方式三】使用Base64编码的图片
# image_url_1 = encode_file("./image_1.png") # 以实际路径为准
# image_url_2 = encode_file("./image_2.png") # 以实际路径为准
print('----sync call, please wait a moment----')
rsp = ImageSynthesis.call(api_key=api_key,
model="wan2.5-i2i-preview",
prompt="将图1中的闹钟放置到图2的餐桌的花瓶旁边位置",
images=[image_url_1, image_url_2],
negative_prompt="",
n=1,
# size="1280*1280",
watermark=False,
seed=12345)
print('response: %s' % rsp)
if rsp.status_code == HTTPStatus.OK:
# 在当前目录下保存图片
for result in rsp.output.results:
file_name = PurePosixPath(unquote(urlparse(result.url).path)).parts[-1]
with open('./%s' % file_name, 'wb+') as f:
f.write(requests.get(result.url).content)
else:
print('sync_call Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
响应示例
url 有效期24小时,请及时下载图像。
{
"status_code": 200,
"request_id": "8ad45834-4321-44ed-adf5-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "3aff9ebd-35fc-4339-98a3-xxxxxx",
"task_status": "SUCCEEDED",
"results": [
{
"url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.png?Expires=xxx",
"orig_prompt": "将图1中的闹钟放置到图2的餐桌的花瓶旁边位置"
}
],
"submit_time": "2025-10-23 16:18:16.009",
"scheduled_time": "2025-10-23 16:18:16.040",
"end_time": "2025-10-23 16:19:09.591",
"task_metrics": {
"TOTAL": 1,
"FAILED": 0,
"SUCCEEDED": 1
}
},
"usage": {
"image_count": 1
}
}
Java
本示例支持三种图像输入方式:公网URL、Base64编码、本地文件路径。
请求示例
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesis;
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesisParam;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
public class Image2Image {
static {
// 以下为北京地域url,若使用新加坡地域的模型,需将url替换为:https://dashscope-intl.aliyuncs.com/api/v1
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
}
// 若没有配置环境变量,请用百炼API Key将下行替换为:apiKey="sk-xxx"
// 新加坡和北京地域的API Key不同。获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
/**
* 图像输入方式说明:三选一即可
*
* 1. 使用公网URL - 适合已有公开可访问的图片
* 2. 使用本地文件 - 适合本地开发测试
* 3. 使用Base64编码 - 适合私有图片或需要加密传输的场景
*/
//【方式一】公网URL
static String imageUrl_1 = "https://img.alicdn.com/imgextra/i3/O1CN0157XGE51l6iL9441yX_!!6000000004770-49-tps-1104-1472.webp";
static String imageUrl_2 = "https://img.alicdn.com/imgextra/i3/O1CN01SfG4J41UYn9WNt4X1_!!6000000002530-49-tps-1696-960.webp";
//【方式二】本地文件路径(file://+绝对路径 or file:///+绝对路径)
// static String imageUrl_1 = "file://" + "/your/path/to/image_1.png"; // Linux/macOS
// static String imageUrl_2 = "file:///" + "C:/your/path/to/image_2.png"; // Windows
//【方式三】Base64编码
// static String imageUrl_1 = encodeFile("/your/path/to/image_1.png");
// static String imageUrl_2 = encodeFile("/your/path/to/image_2.png");
// 设置待编辑的图片列表
static List<String> imageUrls = new ArrayList<>();
static {
imageUrls.add(imageUrl_1);
imageUrls.add(imageUrl_2);
}
public static void syncCall() {
// 设置parameters参数
Map<String, Object> parameters = new HashMap<>();
parameters.put("watermark", false);
parameters.put("seed", "12345");
ImageSynthesisParam param =
ImageSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.5-i2i-preview")
.prompt("将图1中的闹钟放置到图2的餐桌的花瓶旁边位置")
.images(imageUrls)
.n(1)
//.size("1280*1280")
.negativePrompt("")
.parameters(parameters)
.build();
ImageSynthesis imageSynthesis = new ImageSynthesis();
ImageSynthesisResult result = null;
try {
System.out.println("---sync call, please wait a moment----");
result = imageSynthesis.call(param);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
}
System.out.println(JsonUtils.toJson(result));
}
/**
* 将文件编码为Base64字符串
* @param filePath 文件路径
* @return Base64字符串,格式为 data:{MIME_type};base64,{base64_data}
*/
public static String encodeFile(String filePath) {
Path path = Paths.get(filePath);
if (!Files.exists(path)) {
throw new IllegalArgumentException("文件不存在: " + filePath);
}
// 检测MIME类型
String mimeType = null;
try {
mimeType = Files.probeContentType(path);
} catch (IOException e) {
throw new IllegalArgumentException("无法检测文件类型: " + filePath);
}
if (mimeType == null || !mimeType.startsWith("image/")) {
throw new IllegalArgumentException("不支持或无法识别的图像格式");
}
// 读取文件内容并编码
byte[] fileBytes = null;
try{
fileBytes = Files.readAllBytes(path);
} catch (IOException e) {
throw new IllegalArgumentException("无法读取文件内容: " + filePath);
}
String encodedString = Base64.getEncoder().encodeToString(fileBytes);
return "data:" + mimeType + ";base64," + encodedString;
}
public static void main(String[] args) {
syncCall();
}
}响应示例
url 有效期24小时,请及时下载图像。
{
"request_id": "d362685b-757f-4eac-bab5-xxxxxx",
"output": {
"task_id": "bfa7fc39-3d87-4fa7-b1e6-xxxxxx",
"task_status": "SUCCEEDED",
"results": [
{
"orig_prompt": "将图1中的闹钟放置到图2的餐桌的花瓶旁边位置",
"url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.png?Expires=xxx"
}
],
"task_metrics": {
"TOTAL": 1,
"SUCCEEDED": 1,
"FAILED": 0
}
},
"usage": {
"image_count": 1
}
}异步调用
推荐安装最新版DashScope SDK,否则可能运行报错:安装或升级SDK。
Python
本示例使用公网URL方式传入图片。
请求示例
import os
from http import HTTPStatus
from urllib.parse import urlparse, unquote
from pathlib import PurePosixPath
import dashscope
import requests
from dashscope import ImageSynthesis
# 以下为北京地域url,若使用新加坡地域的模型,需将url替换为:https://dashscope-intl.aliyuncs.com/api/v1
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
# 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
# 新加坡和北京地域的API Key不同。获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
# 使用公网图片 URL
image_url_1 = "https://img.alicdn.com/imgextra/i3/O1CN0157XGE51l6iL9441yX_!!6000000004770-49-tps-1104-1472.webp"
image_url_2 = "https://img.alicdn.com/imgextra/i3/O1CN01SfG4J41UYn9WNt4X1_!!6000000002530-49-tps-1696-960.webp"
def async_call():
print('----create task----')
task_info = create_async_task()
print('----wait task----')
wait_async_task(task_info)
# 创建异步任务
def create_async_task():
rsp = ImageSynthesis.async_call(api_key=api_key,
model="wan2.5-i2i-preview",
prompt="将图1中的闹钟放置到图2的餐桌的花瓶旁边位置",
images=[image_url_1, image_url_2],
negative_prompt="",
n=1,
# size="1280*1280",
watermark=False,
seed=12345)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
return rsp
# 等待异步任务结束
def wait_async_task(task):
rsp = ImageSynthesis.wait(task)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output)
# save file to current directory
for result in rsp.output.results:
file_name = PurePosixPath(unquote(urlparse(result.url).path)).parts[-1]
with open('./%s' % file_name, 'wb+') as f:
f.write(requests.get(result.url).content)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
# 获取异步任务信息
def fetch_task_status(task):
status = ImageSynthesis.fetch(task)
print(status)
if status.status_code == HTTPStatus.OK:
print(status.output.task_status)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(status.status_code, status.code, status.message))
# 取消异步任务,只有处于PENDING状态的任务才可以取消
def cancel_task(task):
rsp = ImageSynthesis.cancel(task)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.task_status)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
async_call()
响应示例
1、创建任务的响应示例
{
"status_code": 200,
"request_id": "31b04171-011c-96bd-ac00-f0383b669cc7",
"code": "",
"message": "",
"output": {
"task_id": "4f90cf14-a34e-4eae-xxxxxxxx",
"task_status": "PENDING",
"results": []
},
"usage": null
}2、查询任务结果的响应示例
url 有效期24小时,请及时下载图像。
{
"status_code": 200,
"request_id": "8ad45834-4321-44ed-adf5-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "3aff9ebd-35fc-4339-98a3-xxxxxx",
"task_status": "SUCCEEDED",
"results": [
{
"url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.png?Expires=xxx",
"orig_prompt": "将图1中的闹钟放置到图2的餐桌的花瓶旁边位置"
}
],
"submit_time": "2025-10-23 16:18:16.009",
"scheduled_time": "2025-10-23 16:18:16.040",
"end_time": "2025-10-23 16:19:09.591",
"task_metrics": {
"TOTAL": 1,
"FAILED": 0,
"SUCCEEDED": 1
}
},
"usage": {
"image_count": 1
}
}
Java
本示例默认使用公网URL方式传入图片。
请求示例
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesis;
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesisListResult;
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesisParam;
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.task.AsyncTaskListParam;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Image2Image {
static {
// 以下为北京地域url,若使用新加坡地域的模型,需将url替换为:https://dashscope-intl.aliyuncs.com/api/v1
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
}
// 若没有配置环境变量,请用百炼API Key将下行替换为:apiKey="sk-xxx"
// 新加坡和北京地域的API Key不同。获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
//公网URL
static String imageUrl_1 = "https://img.alicdn.com/imgextra/i3/O1CN0157XGE51l6iL9441yX_!!6000000004770-49-tps-1104-1472.webp";
static String imageUrl_2 = "https://img.alicdn.com/imgextra/i3/O1CN01SfG4J41UYn9WNt4X1_!!6000000002530-49-tps-1696-960.webp";
// 设置待编辑的图片列表
static List<String> imageUrls = new ArrayList<>();
static {
imageUrls.add(imageUrl_1);
imageUrls.add(imageUrl_2);
}
public static void asyncCall() {
// 设置parameters参数
Map<String, Object> parameters = new HashMap<>();
parameters.put("watermark", false);
parameters.put("seed", "12345");
ImageSynthesisParam param =
ImageSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.5-i2i-preview")
.prompt("将图1中的闹钟放置到图2的餐桌的花瓶旁边位置")
.images(imageUrls)
.n(1)
//.size("1280*1280")
.negativePrompt("")
.parameters(parameters)
.build();
ImageSynthesis imageSynthesis = new ImageSynthesis();
ImageSynthesisResult result = null;
try {
System.out.println("---async call, please wait a moment----");
result = imageSynthesis.asyncCall(param);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
}
System.out.println(JsonUtils.toJson(result));
String taskId = result.getOutput().getTaskId();
System.out.println("taskId=" + taskId);
try {
result = imageSynthesis.wait(taskId, apiKey);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
}
System.out.println(JsonUtils.toJson(result));
System.out.println(JsonUtils.toJson(result.getOutput()));
}
public static void listTask() throws ApiException, NoApiKeyException {
ImageSynthesis is = new ImageSynthesis();
AsyncTaskListParam param = AsyncTaskListParam.builder().build();
ImageSynthesisListResult result = is.list(param);
System.out.println(result);
}
public void fetchTask(String taskId) throws ApiException, NoApiKeyException {
ImageSynthesis is = new ImageSynthesis();
// 如果已设置 DASHSCOPE_API_KEY 为环境变量,apiKey 可为空。
ImageSynthesisResult result = is.fetch(taskId, null);
System.out.println(result.getOutput());
System.out.println(result.getUsage());
}
public static void main(String[] args) {
asyncCall();
}
}响应示例
1、创建任务的响应示例
{
"request_id": "5dbf9dc5-4f4c-9605-85ea-542f97709ba8",
"output": {
"task_id": "7277e20e-aa01-4709-xxxxxxxx",
"task_status": "PENDING"
}
}2、查询任务结果的响应示例
url 有效期24小时,请及时下载图片。
{
"request_id": "d362685b-757f-4eac-bab5-xxxxxx",
"output": {
"task_id": "bfa7fc39-3d87-4fa7-b1e6-xxxxxx",
"task_status": "SUCCEEDED",
"results": [
{
"orig_prompt": "将图1中的闹钟放置到图2的餐桌的花瓶旁边位置",
"url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.png?Expires=xxx"
}
],
"task_metrics": {
"TOTAL": 1,
"SUCCEEDED": 1,
"FAILED": 0
}
},
"usage": {
"image_count": 1
}
}curl
本示例包含创建任务和查询结果两个步骤。
异步调用必须设置 Header 参数
X-DashScope-Async为enable。异步任务的
task_id查询有效期为 24 小时,过期后任务状态将变为UNKNOWN。新手建议使用 Postman调用API。
步骤1:发起创建任务请求
该请求会返回一个任务ID(task_id)。
请求示例
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wan2.5-i2i-preview",
"input": {
"prompt": "将图1中的闹钟放置到图2的餐桌的花瓶旁边位置",
"images": [
"https://img.alicdn.com/imgextra/i3/O1CN0157XGE51l6iL9441yX_!!6000000004770-49-tps-1104-1472.webp",
"https://img.alicdn.com/imgextra/i3/O1CN01SfG4J41UYn9WNt4X1_!!6000000002530-49-tps-1696-960.webp"
]
},
"parameters": {
//"size": "1280*1280",
"n": 1
}
}'响应示例
{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}步骤2:根据任务ID查询结果
使用上一步获取的 task_id,通过接口轮询任务状态,直到 task_status 变为 SUCCEEDED 或 FAILED。
请求示例
请将86ecf553-d340-4e21-xxxxxxxxx替换为真实的task_id。
curl -X GET https://dashscope.aliyuncs.com/api/v1/tasks/86ecf553-d340-4e21-xxxxxxxxx \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"响应示例
图像URL有效期为24小时,请及时下载图像。
{
"request_id": "d1f2a1be-9c58-48af-b43f-xxxxxx",
"output": {
"task_id": "7f4836cd-1c47-41b3-b3a4-xxxxxx",
"task_status": "SUCCEEDED",
"submit_time": "2025-09-23 22:14:10.800",
"scheduled_time": "2025-09-23 22:14:10.825",
"end_time": "2025-09-23 22:15:23.456",
"results": [
{
"orig_prompt": "将图1中的闹钟放置到图2的餐桌的花瓶旁边位置",
"url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.png?Expires=xxx"
}
],
"task_metrics": {
"TOTAL": 1,
"FAILED": 0,
"SUCCEEDED": 1
}
},
"usage": {
"image_count": 1
}
}支持的模型
模型列表和价格请参见通义万相通用图像编辑2.5。
输入说明
入参结构(images)
images是一个数组,最多支持输入 3张 图片进行编辑或融合。输入图片必须满足以下要求:
图片格式:支持 JPEG、JPG、PNG (不支持透明通道)、BMP、WEBP。
图片分辨率:图像的宽高范围均为[384, 5000]像素。
文件大小:单张图片文件大小不得超过 10MB。
// 仅展示images结构,以下为输入2张图像
{
"images": [
"https://img.alicdn.com/imgextra/i4/O1CN01TlDlJe1LR9zso3xAC_!!6000000001295-2-tps-1104-1472.png",
"https://img.alicdn.com/imgextra/i4/O1CN01M9azZ41YdblclkU6Z_!!6000000003082-2-tps-1696-960.png"
]
}图像输入顺序
多图输入时,按照数组顺序定义图像顺序。提示词需要与图像数组中的顺序一一对应,例如:数组中的第一张图片为“图1”,第二张为“图2”,或者使用标记形式如“[图1]”、“[图2]”。请确保提示词中引用的图像编号与输入顺序保持一致,以获得符合期望的编辑效果。
输入图像 | 输出图像 | ||
图1 |
图2 |
提示词:把图1移动到图2上 |
提示词:把图2移动到图1上 |
图像传入方式
本模型支持通过以下三种方式传入图像:
更多参数说明
本模型还提供一系列可选参数用于调整图像生成效果。其中重要参数包括:
size:设置输出图像的分辨率,格式为宽*高。默认值为1280*1280。图像分辨率总像素在 [768*768, 1280*1280] 之间,且宽高比范围为 [1:4, 4:1]。n:设置输出图像的数量。取值范围为1~4张,默认为4。测试阶段建议设置为1。negative_prompt(反向提示词):描述不希望在画面中出现的内容,如“模糊”、“多余的手指”等。仅用于辅助优化生成质量。watermark:是否添加水印标识,水印位于图片右下角,文案固定为“AI生成”。默认为false,表示不添加水印。seed:随机数种子。取值范围是[0, 2147483647]。如果不提供,则算法自动生成一个随机数作为种子。如果希望生成内容保持相对稳定,可使用相同的seed参数值。注意:由于模型生成具有概率性,相同 seed也不能保证每次生成结果完全一致。
输出说明
输出图像规格为:
图片格式:PNG。
图像分辨率:
可通过
size参数指定输出图像的分辨率,格式为宽*高(单位:像素)。若未指定分辨率,系统将默认生成总像素为
1280*1280的图像,并依据以下规则保持宽高比(近似值):输入单图时:保持与输入图像一致。
输入多图时:保持与最后一张输入图像一致。
更多效果展示
多图融合
输入图像 | 输出图像 |
|
把图2的星空画作迁移到图1的手机壳上 |
|
以[图1]的字体文字造型“Wan2.5”为唯一依据,保持笔画粗细与曲线不变;将[图2]的层叠纸材质精准迁移到文字。 |
|
使用两张参考图进行定向重绘:以[图2]为包包的造型与结构参考,以[图1]中的鹦鹉羽毛为颜色与纹理参考,将鹦鹉羽毛的色彩与纹理质感精准迁移到[图2]的包面材质上。 |
|
融合[图1][图2]制作太空主题海报:让[图2]的玩偶漂浮宇宙中,双手捧起悬浮的[图1]logo;logo为发光立体紫色透明材质,具折射与体积光,光晕映照玩偶与周围微尘。背景深空星云与星尘轨迹,右上加入远景环形空间站与灯带细节,主体居中突出、留白均衡。标题置顶“通义万相发布”:几何无衬线超黑体、字距略宽、纯白主色+紫蓝外发光+细银描边;副标题其下“Unleash Your Creativity”:轻细无衬线、浅紫至青蓝渐变、微内阴影与柔光。整体紫蓝调,高分辨率,不加其他文字。 |
|
以[图1]名片设计稿的构图与磨砂玻璃质感为模板,为[图2]人物生成竖版工作卡。圆角半透明卡面,柔和高光与浅投影;人物胸像置于中上区域;左下排版姓名/职位/公司/电话,极简无衬线字体,留白均衡。右上角放置[图1]人物的可爱3D卡通形象,打破边界半浮出卡片并投下轻影,形成层次与视觉焦点。整体明亮自然光、真实材质细节,不添加多余图案与元素。 |
图像理解
目标检测与定位
检测图像中指定的目标,输出一张带有检测框和标签的图像。
输入图像 | 输出图像 |
|
检测图中的向日葵和南瓜,绘制检测框并标上标签 |
实例分割
模型将为图像中每个独立对象生成一个专属颜色区域,展示其完整轮廓。例如,输出图像的紫色区域代表被分割出的耳机实例。
输入图像 | 输出图像 |
|
分割出图中的耳机 |
主体特征保持
输入图像 | 输出图像 |
|
Generate a highly detailed photo of a girl cosplaying this illustration, at Comiket. It must be a real person cosplaying. Exactly replicate the same pose, body posture, hand gestures, facial expression, and camera framing as in the original illustration. Keep the same angle, perspective, and composition, without any deviation. |
|
在办公室场景中生成3个同样的该照片中的人物,其中一个坐在办公桌前办公,另一个站着在喝咖啡,第三个靠在办公桌前在看书,这3个人是同一个人,都是照片中的那个人物。 |
|
为这张照片生成一个4宫格套图,第一张让这个女孩身体正面面向镜头,第二张让她举起右手撩头发,第三组让她向屏幕前的观众热情地挥手打招呼,第四张她的表情要闭上眼微笑 |
修改及放大
功能 | 输入图像 | 输出图像 |
修改元素 |
|
将花卉连衣裙换成一件复古风格的蕾丝长裙,领口和袖口有精致的刺绣细节。 |
修改光线 |
|
在海星表面添加小而闪烁的高光,使其在夕阳背景下呈现出发光的效果。 |
放大主体元素 |
|
把图中的牛放大 |
放大图像细节 |
|
放大并展现鹦鹉栖息的树枝 |
提取元素
输入图像 | 输出图像 |
|
将图中人物身穿的服饰单品都提取出来,摆放在白底背景中,整齐地排列。 |
线稿生图
输入图像 | 输出图像 |
|
Generate a new real image based on this sketch, a charming Mediterranean village scene with rustic stone buildings featuring terracotta roofs, wooden shutters, and balconies adorned with hanging laundry. The foreground is filled with lush greenery, including climbing vines and blooming flowers, creating a vibrant and lively atmosphere. The architecture showcases intricate details like arched doorways and patterned stonework, evoking a sense of history and warmth], [a bright, sunny day with clear blue skies, casting soft shadows across the cobblestone streets and enhancing the warm tones of the buildings. In the background, rolling hills and distant mountains provide a picturesque setting, adding depth and serenity to the scene. |
文字生成
输入图像 | 输出图像 |
|
在图片的左上角添加大号圆角字体的白色标题文字:“微距摄影”,标题文字下面有淡绿色小号副标题:“勤劳就有收获”。 |
去水印
输入图像 | 输出图像 |
|
去除左上角所有文字 |
扩图
输入图像 | 输出图像 |
|
向外扩图,生成这张图的远景照片 |
计费与限流
API参考
输入和输出参数请参见通义万相-通用图像编辑2.5 API参考。
常见问题
Q:之前使用通用图像编辑 2.1,现在切换到 wan2.5 模型,SDK调用方式需要调整吗?
A:需要调整。两个版本的参数设计不同:











































