seedream-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSeedream Image
Seedream 图像生成
Generate AI images using ByteDance Seedream 4.5. Use when you need to: (1) create images from text descriptions, (2) transform images with style transfer, or (3) generate high-quality artistic or realistic images.
使用ByteDance Seedream 4.5生成AI图像。适用于以下场景:(1) 根据文本描述创建图像;(2) 通过风格迁移转换图像;(3) 生成高质量的艺术或写实风格图像。
Input
输入参数
Provide input as JSON:
json
{
"prompt": "Text description of the image you want to generate or edit",
"image_size": "Image size: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto_2K, auto_4K (default: auto_2K)",
"num_images": "Number of images to generate (1-10, default: 1)",
"reference_image": "<file-id>",
"enable_safety_checker": "Enable safety checker (true/false, default: true)"
}Note on File Input:
- is optional and requires a file ID (format:
reference_image) if provideddf-xxxxx - How to get file ID:
- Upload your reference image to Refly using
refly file upload <file-path> - Copy the returned file ID from the upload response
- Use this file ID in the input JSON
- Upload your reference image to Refly using
- Omit for pure text-to-image generation
reference_image - Provide for image-to-image editing (supports up to 10 images)
reference_image
请以JSON格式提供输入:
json
{
"prompt": "你想要生成或编辑的图像的文本描述",
"image_size": "图像尺寸:square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto_2K, auto_4K(默认值:auto_2K)",
"num_images": "生成图像的数量(1-10,默认值:1)",
"reference_image": "<文件ID>",
"enable_safety_checker": "启用安全检查器(true/false,默认值:true)"
}文件输入说明:
- 为可选参数,若提供则需要文件ID(格式:
reference_image)df-xxxxx - 获取文件ID的方法:
- 使用 将参考图像上传至Refly
refly file upload <文件路径> - 从上传响应中复制返回的文件ID
- 在输入JSON中使用该文件ID
- 使用
- 纯文本转图像生成时可省略
reference_image - 图像转图像编辑时需提供 (最多支持10张图像)
reference_image
API Request Structure
API 请求结构
This skill uses Seedream 4.5 API with the following structure:
本技能使用Seedream 4.5 API,结构如下:
Text-to-Image
Text-to-Image
json
{
"prompt": "Your prompt here",
"image_size": "auto_2K",
"num_images": 1,
"max_images": 1,
"enable_safety_checker": true
}json
{
"prompt": "你的提示词",
"image_size": "auto_2K",
"num_images": 1,
"max_images": 1,
"enable_safety_checker": true
}Image-to-Image (With Reference)
Image-to-Image (With Reference)
json
{
"prompt": "Edit instructions here",
"image_size": "auto_4K",
"num_images": 1,
"max_images": 1,
"enable_safety_checker": true,
"image_urls": [
"URL_of_reference_image_1",
"URL_of_reference_image_2"
]
}Notes:
- When is empty/not provided → Text-to-Image mode
image_urls - When is provided → Image-to-Image mode
image_urls - Supports up to 10 input images
- Total images (input + output) must not exceed 15
- options: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto_2K, auto_4K
image_size
json
{
"prompt": "编辑指令",
"image_size": "auto_4K",
"num_images": 1,
"max_images": 1,
"enable_safety_checker": true,
"image_urls": [
"参考图像1的URL",
"参考图像2的URL"
]
}注意事项:
- 当 为空或未提供时 → Text-to-Image模式
image_urls - 当提供 时 → Image-to-Image模式
image_urls - 最多支持10张输入图像
- 总图像数(输入+输出)不得超过15张
- 可选值:square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto_2K, auto_4K
image_size
Execution (Pattern A: File Generation)
执行步骤(模式A:文件生成)
Step 0 (Optional): Upload Reference Image
步骤0(可选):上传参考图像
bash
undefinedbash
undefinedUpload a reference image for image-to-image generation
为图像转图像生成上传参考图像
REF_RESULT=$(refly file upload /path/to/reference.jpg)
REF_FILE_ID=$(echo "$REF_RESULT" | jq -r '.payload.fileId')
echo "Reference image file ID: $REF_FILE_ID"
undefinedREF_RESULT=$(refly file upload /path/to/reference.jpg)
REF_FILE_ID=$(echo "$REF_RESULT" | jq -r '.payload.fileId')
echo "参考图像文件ID:$REF_FILE_ID"
undefinedStep 1: Run the Skill and Get Run ID
步骤1:运行技能并获取运行ID
Example 1: Text-to-Image
bash
RESULT=$(refly skill run --id skpi-m56jo9am75xgijga62hd7t8g --input '{
"prompt": "A beautiful mountain landscape at sunset with vibrant colors",
"image_size": "landscape_16_9",
"num_images": 1,
"enable_safety_checker": true
}')
RUN_ID=$(echo "$RESULT" | jq -r '.payload.workflowExecutions[0].id')Example 2: Image-to-Image Editing
bash
undefined示例1:文本转图像
bash
RESULT=$(refly skill run --id skpi-m56jo9am75xgijga62hd7t8g --input '{
"prompt": "日落时分色彩绚丽的美丽山地风景",
"image_size": "landscape_16_9",
"num_images": 1,
"enable_safety_checker": true
}')
RUN_ID=$(echo "$RESULT" | jq -r '.payload.workflowExecutions[0].id')示例2:图像转图像编辑
bash
undefinedUse the REF_FILE_ID from Step 0
使用步骤0中获取的REF_FILE_ID
RESULT=$(refly skill run --id skpi-m56jo9am75xgijga62hd7t8g --input '{
"prompt": "Transform this into anime style with vibrant colors and dramatic lighting",
"reference_image": "'"$REF_FILE_ID"'",
"image_size": "auto_4K",
"num_images": 1,
"enable_safety_checker": true
}')
RUN_ID=$(echo "$RESULT" | jq -r '.payload.workflowExecutions[0].id')
undefinedRESULT=$(refly skill run --id skpi-m56jo9am75xgijga62hd7t8g --input '{
"prompt": "将其转换为动漫风格,色彩鲜艳且光影效果夸张",
"reference_image": "'"$REF_FILE_ID"'",
"image_size": "auto_4K",
"num_images": 1,
"enable_safety_checker": true
}')
RUN_ID=$(echo "$RESULT" | jq -r '.payload.workflowExecutions[0].id')
undefinedStep 2: Open Workflow in Browser and Wait for Completion
步骤2:在浏览器中打开工作流并等待完成
bash
open "https://refly.ai/workflow/c-i51ssnvhcjdou7l0h3ote7d9"
refly workflow status "$RUN_ID" --watch --interval 30000bash
open "https://refly.ai/workflow/c-i51ssnvhcjdou7l0h3ote7d9"
refly workflow status "$RUN_ID" --watch --interval 30000Step 3: Download and Show Result
步骤3:下载并查看结果
bash
undefinedbash
undefinedGet files from this run
获取本次运行生成的文件
FILES=$(refly workflow toolcalls "$RUN_ID" --files --latest | jq -r '.payload.files[]')
FILES=$(refly workflow toolcalls "$RUN_ID" --files --latest | jq -r '.payload.files[]')
Download and open each file
下载并打开每个文件
echo "$FILES" | jq -c '.' | while read -r file; do
FILE_ID=$(echo "$file" | jq -r '.fileId')
FILE_NAME=$(echo "$file" | jq -r '.name')
if [ -n "$FILE_ID" ] && [ "$FILE_ID" != "null" ]; then
refly file download "$FILE_ID" -o "$HOME/Desktop/${FILE_NAME}"
open "$HOME/Desktop/${FILE_NAME}"
fi
done
undefinedecho "$FILES" | jq -c '.' | while read -r file; do
FILE_ID=$(echo "$file" | jq -r '.fileId')
FILE_NAME=$(echo "$file" | jq -r '.name')
if [ -n "$FILE_ID" ] && [ "$FILE_ID" != "null" ]; then
refly file download "$FILE_ID" -o "$HOME/Desktop/${FILE_NAME}"
open "$HOME/Desktop/${FILE_NAME}"
fi
done
undefinedExpected Output
预期输出
- Type: Image
- Format: .png/.jpg image file
- Location:
~/Desktop/ - Action: Opens automatically to show user
- 类型:图像
- 格式:.png/.jpg 图像文件
- 位置:
~/Desktop/ - 操作:自动打开以展示给用户
Rules
规则
Follow base skill workflow:
~/.claude/skills/refly/SKILL.md遵循基础技能工作流:
~/.claude/skills/refly/SKILL.md