seedream-image

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Seedream 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:
  • reference_image
    is optional and requires a file ID (format:
    df-xxxxx
    ) if provided
  • How to get file ID:
    1. Upload your reference image to Refly using
      refly file upload <file-path>
    2. Copy the returned file ID from the upload response
    3. Use this file ID in the input JSON
  • Omit
    reference_image
    for pure text-to-image generation
  • Provide
    reference_image
    for image-to-image editing (supports up to 10 images)
请以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)"
}
文件输入说明:
  • reference_image
    为可选参数,若提供则需要文件ID(格式:
    df-xxxxx
  • 获取文件ID的方法:
    1. 使用
      refly file upload <文件路径>
      将参考图像上传至Refly
    2. 从上传响应中复制返回的文件ID
    3. 在输入JSON中使用该文件ID
  • 纯文本转图像生成时可省略
    reference_image
  • 图像转图像编辑时需提供
    reference_image
    (最多支持10张图像)

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
    image_urls
    is empty/not provided → Text-to-Image mode
  • When
    image_urls
    is provided → Image-to-Image mode
  • Supports up to 10 input images
  • Total images (input + output) must not exceed 15
  • image_size
    options: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto_2K, auto_4K
json
{
  "prompt": "编辑指令",
  "image_size": "auto_4K",
  "num_images": 1,
  "max_images": 1,
  "enable_safety_checker": true,
  "image_urls": [
    "参考图像1的URL",
    "参考图像2的URL"
  ]
}
注意事项:
  • image_urls
    为空或未提供时 → Text-to-Image模式
  • 当提供
    image_urls
    时 → Image-to-Image模式
  • 最多支持10张输入图像
  • 总图像数(输入+输出)不得超过15张
  • image_size
    可选值:square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto_2K, auto_4K

Execution (Pattern A: File Generation)

执行步骤(模式A:文件生成)

Step 0 (Optional): Upload Reference Image

步骤0(可选):上传参考图像

bash
undefined
bash
undefined

Upload 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"
undefined
REF_RESULT=$(refly file upload /path/to/reference.jpg) REF_FILE_ID=$(echo "$REF_RESULT" | jq -r '.payload.fileId') echo "参考图像文件ID:$REF_FILE_ID"
undefined

Step 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
undefined

Use 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')
undefined
RESULT=$(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')
undefined

Step 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 30000
bash
open "https://refly.ai/workflow/c-i51ssnvhcjdou7l0h3ote7d9"
refly workflow status "$RUN_ID" --watch --interval 30000

Step 3: Download and Show Result

步骤3:下载并查看结果

bash
undefined
bash
undefined

Get 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
undefined
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
undefined

Expected 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