使用字节跳动Seedream V4.5模型通过WaveSpeed AI生成和编辑图像。支持文生图、多图像编辑和自定义分辨率。
WaveSpeedAI Seedream V4.5 图像生成/编辑. 通过WaveSpeed AI平台使用ByteDance的Seedream V4.5模式对图是一项面向实际任务的技能。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;
涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。
通过 WaveSpeed AI 平台,使用字节跳动(ByteDance)的 Seedream V4.5 模型进行图像生成与编辑。支持最高达 4096×4096 的自定义分辨率,并针对海报与 Logo 中的文字渲染进行了增强排版优化,确保文字清晰锐利。
export WAVESPEED_API_KEY="your-api-key"
请前往 wavespeed.ai/accesskey 获取您的 API 密钥。
import wavespeed from 'wavespeed';
const output_url = (await wavespeed.run(
"bytedance/seedream-v4.5",
{ prompt: "一个极简风格的咖啡馆 Logo,采用干净的字体排版" }
))["outputs"][0];
images 参数接受一个图像 URL 数组(1–10 张图像)。若您使用本地文件,请先调用 wavespeed.upload() 上传以获取可访问的 URL。
import wavespeed from 'wavespeed';
// 上传本地图像以获取 URL
const imageUrl = await wavespeed.upload("/path/to/photo.png");
const output_url = (await wavespeed.run(
"bytedance/seedream-v4.5/edit",
{
images: [imageUrl],
prompt: "添加温暖的日落光照效果及镜头光晕"
}
))["outputs"][0];
您也可直接传入已有的图像 URL:
const output_url = (await wavespeed.run(
"bytedance/seedream-v4.5/edit",
{
images: ["https://example.com/photo.jpg"],
prompt: "添加温暖的日落光照效果及镜头光晕"
}
))["outputs"][0];
模型 ID:bytedance/seedream-v4.5
基于文本提示词生成图像,支持最高达 4096×4096 的自定义输出分辨率。
| 参数 | 类型 | 是否必需 | 默认值 | 说明 |
|---|---|---|---|---|
prompt |
string | 是 | -- | 用于生成图像的文本描述 |
size |
string | 否 | 2048*2048 |
输出尺寸(单位:像素),格式为 WIDTH*HEIGHT;单边尺寸范围为 1024–4096。 |
import wavespeed from 'wavespeed';
const output_url = (await wavespeed.run(
"bytedance/seedream-v4.5",
{
prompt: "一张科幻惊悚电影海报,顶部有加粗标题文字‘HORIZON’",
size: "2048*3072"
}
))["outputs"][0];
模型 ID:bytedance/seedream-v4.5/edit
基于文本提示词对已有图像进行编辑,最多支持 10 张输入图像;在编辑过程中保留原始图像中的人脸特征、光照与色彩基调。
| 参数 | 类型 | 是否必需 | 默认值 | 说明 |
|---|---|---|---|---|
images |
string[] | 是 | [] |
待编辑图像的 URL 列表(1–10 张),URL 必须可公开访问。 |
prompt |
string | 是 | -- | 描述期望编辑效果的文本 |
size |
string | 否 | -- | 输出尺寸(单位:像素),格式为 WIDTH*HEIGHT;单边尺寸范围为 1024–4096。 |
import wavespeed from 'wavespeed';
const imageUrl = await wavespeed.upload("/path/to/portrait.png");
const output_url = (await wavespeed.run(
"bytedance/seedream-v4.5/edit",
{
images: [imageUrl],
prompt: "转换为鲜艳的波普艺术风格,配以高饱和度色彩",
size: "2048*2048"
}
))["outputs"][0];
const img1 = await wavespeed.upload("/path/to/face.png");
const img2 = await wavespeed.upload("/path/to/scene.png");
const output_url = (await wavespeed.run(
"bytedance/seedream-v4.5/edit",
{
images: [img1, img2],
prompt: "将第一张图像中的人物置入第二张图像的场景中"
}
))["outputs"][0];
const output_url = (await wavespeed.run(
"bytedance/seedream-v4.5",
{ prompt: "一幅水彩风格的黎明山湖风景画" },
{ enableSyncMode: true }
))["outputs"][0];
import { Client } from 'wavespeed';
const client = new Client("your-api-key", {
maxRetries: 2,
maxConnectionRetries: 5,
retryInterval: 1.0,
});
const output_url = (await client.run(
"bytedance/seedream-v4.5",
{ prompt: "一个霓虹灯招牌,文字为‘OPEN 24/7’,背景为雨巷" }
))["outputs"][0];
import { Client, WavespeedTimeoutException, WavespeedPredictionException } from 'wavespeed';
const client = new Client();
const result = await client.runNoThrow(
"bytedance/seedream-v4.5",
{ prompt: "一张东京复古旅行海报" }
);
if (result.outputs) {
console.log("图像 URL:", result.outputs[0]);
console.log("任务 ID:", result.detail.taskId);
} else {
console.log("失败:", result.detail.error.message);
if (result.detail.error instanceof WavespeedTimeoutException) {
console.log("请求超时 — 建议增加超时时间");
} else if (result.detail.error instanceof WavespeedPredictionException) {
console.log("生成任务失败");
}
}
每张图像 $0.04(含图像生成与图像编辑)。
WIDTH*HEIGHT(例如:竖版海报可设为 2048*3072)WAVESPEED_API_KEY;切勿将其硬编码于源码文件中,或提交至版本控制系统;推荐使用环境变量或密钥管理服务。相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 133.9万人学习
共49课时 | 82.5万人学习