generate-image-by-seedream
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese豆包 Seedream 图像生成
Doubao Seedream Image Generation
使用附带的脚本通过字节跳动图像生成模型生成或编辑图片:
- 豆包 Seedream(即梦 / Dreamina) 系列生图模型
- 支持文生图、图生图、多图参考编辑
默认版本: → 对应 。
默认尺寸:。
4.5doubao-seedream-4-5-2511282KGenerate or edit images via the attached script using ByteDance image generation models:
- Doubao Seedream (Jimeng / Dreamina) series image generation models
- Supports text-to-image, image-to-image, and multi-reference image editing
Default version: → corresponding to .
Default size: .
4.5doubao-seedream-4-5-2511282K模型效果建议
Model Effect Recommendations
- 效果排序:>
4.5>5.04.0 - 推荐优先使用 版本以获得最佳效果
4.5
- Effect ranking: >
4.5>5.04.0 - It is recommended to use version first for the best effect
4.5
画面比例
Aspect Ratio
- 必须在生图提示词(prompt)中明确指定画面比例,例如:“生成可爱小狗,9:16竖屏比例”
- The aspect ratio must be explicitly specified in the image generation prompt, for example: "Generate a cute puppy, 9:16 portrait aspect ratio"
文生图
Text-to-Image
bash
uv run {baseDir}/scripts/generate_image.py --prompt "你的图片描述" --filename "可爱小狗.jpg"bash
uv run {baseDir}/scripts/generate_image.py --prompt "你的图片描述" --filename "可爱小狗.jpg"使用 YAML 配置文件
Use YAML Configuration File
可以将所有生图参数写入 YAML 配置文件,然后通过 参数使用:
--configYou can write all image generation parameters into a YAML configuration file and use it via the parameter:
--config文生图配置示例 (text2image.yaml
):
text2image.yamlText-to-image configuration example (text2image.yaml
):
text2image.yamlyaml
prompt: 一只可爱的小狗在草地上,9:16竖屏比例
filename: 可爱小狗.jpg
size: 2K
version: 4.5yaml
prompt: 一只可爱的小狗在草地上,9:16竖屏比例
filename: 可爱小狗.jpg
size: 2K
version: 4.5图生图配置示例(带参考图列表,image2image.yaml
):
image2image.yamlImage-to-image configuration example (with reference image list, image2image.yaml
):
image2image.yamlyaml
prompt: 将图1的服装换为图2的服装
filename: 换装女孩.jpg
images:
- https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png
- https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imagesToimage_2.png
size: 2K
version: 4.5yaml
prompt: 将图1的服装换为图2的服装
filename: 换装女孩.jpg
images:
- https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png
- https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imagesToimage_2.png
size: 2K
version: 4.5本地参考图配置示例 (local_images.yaml
):
local_images.yamlLocal reference image configuration example (local_images.yaml
):
local_images.yamlyaml
prompt: 多图融合成一张插画
filename: 多图融合插画.jpg
images:
- /path/to/参考图1.jpg
- /path/to/参考图2.png
size: 2K
version: 4.5yaml
prompt: 多图融合成一张插画
filename: 多图融合插画.jpg
images:
- /path/to/参考图1.jpg
- /path/to/参考图2.png
size: 2K
version: 4.5使用方法:
Usage:
bash
uv run {baseDir}/scripts/generate_image.py --config image2image.yamlbash
uv run {baseDir}/scripts/generate_image.py --config image2image.yaml混合使用配置文件和命令行参数(命令行参数优先级更高):
Mix usage of configuration file and command line parameters (command line parameters have higher priority):
bash
uv run {baseDir}/scripts/generate_image.py --config prompt.yaml --filename "自定义文件名.jpg"bash
uv run {baseDir}/scripts/generate_image.py --config prompt.yaml --filename "自定义文件名.jpg"YAML 配置文件支持的所有参数:
All parameters supported by YAML configuration file:
- : 图片描述
prompt - : 输出文件名
filename - : 参考图像列表(可以是 URL 或本地文件路径)
images - : 输出尺寸(如 "2K"、"4K")
size - : Seedream 版本(如 "4.5")
version - : 完整的模型名称(高级选项)
model - : API 密钥
api_key
- : Image description
prompt - : Output file name
filename - : List of reference images (can be URL or local file path)
images - : Output size (e.g. "2K", "4K")
size - : Seedream version (e.g. "4.5")
version - : Full model name (advanced option)
model - : API key
api_key
图生图 / 参考图像(多张图像:URL 或本地文件)
Image-to-Image / Reference Image (multiple images: URL or local file)
bash
uv run {baseDir}/scripts/generate_image.py \
--prompt "将图1的服装换为图2的服装" \
--filename "换装女孩.jpg" \
-i "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png" \
-i "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imagesToimage_2.png" \
--size 2K \
--version 4.5bash
uv run {baseDir}/scripts/generate_image.py \
--prompt "将图1的服装换为图2的服装" \
--filename "换装女孩.jpg" \
-i "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png" \
-i "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imagesToimage_2.png" \
--size 2K \
--version 4.5本地参考图像(多张本地文件)
Local Reference Images (multiple local files)
bash
uv run {baseDir}/scripts/generate_image.py \
--prompt "多图融合成一张插画" \
--filename "多图融合插画.jpg" \
-i "/path/to/参考图1.jpg" \
-i "/path/to/参考图2.png" \
--size 2K \
--version 4.5bash
uv run {baseDir}/scripts/generate_image.py \
--prompt "多图融合成一张插画" \
--filename "多图融合插画.jpg" \
-i "/path/to/参考图1.jpg" \
-i "/path/to/参考图2.png" \
--size 2K \
--version 4.5注意事项
Notes
API 密钥
API Key
- 你要先自动检测是否有 环境变量,没有需要向用户要或者让用户在火山引擎申请
ARK_API_KEY
- You should first automatically detect whether the environment variable exists, if not, you need to ask the user for it or let the user apply for it on Volcano Engine
ARK_API_KEY
版本选项
Version Options
- →
4.0doubao-seedream-4-0-250828 - (默认)→
4.5doubao-seedream-4-5-251128 - →
5.0doubao-seedream-5-0-260128 - 高级选项:仍可通过 等参数覆盖默认映射。
--model doubao-seedream-5-0-lite-260128
- →
4.0doubao-seedream-4-0-250828 - (default) →
4.5doubao-seedream-4-5-251128 - →
5.0doubao-seedream-5-0-260128 - Advanced option: You can still override the default mapping via parameters such as .
--model doubao-seedream-5-0-lite-260128
尺寸选项(按版本)
Size Options (by version)
- :
4.0,1K,2K4K - :
4.5,2K4K - :
5.0,2K3K
- :
4.0,1K,2K4K - :
4.5,2K4K - :
5.0,2K3K
文件名建议(供调用方参考)
File Name Recommendations (for caller reference)
- 不要在文件名里包含 "seedream" 之类的实现细节。
- 文件名语言应与用户 Prompt 语言保持一致,例如中文 Prompt 就用简短中文文件名(如 )。
可爱小狗.jpg - 名字要有语义但尽量简短,避免过长句子。
- Do not include implementation details such as "seedream" in the file name.
- The language of the file name should be consistent with the language of the user's prompt. For example, use a short Chinese file name for Chinese prompts (e.g. ).
可爱小狗.jpg - The name should be semantic but as short as possible, avoid overly long sentences.
关键词提示(供搜索发现)
Keyword Tips (for search discovery)
- "doubao", "豆包", "即梦", "Seedream", "dreamina"
- "ByteDance image model", "字节跳动生图模型"
- "文生图", "图生图", "参考图", "图片生成", "图像生成", "换装", "图片编辑"
- "doubao", "豆包", "即梦", "Seedream", "dreamina"
- "ByteDance image model", "字节跳动生图模型"
- "文生图", "图生图", "参考图", "图片生成", "图像生成", "换装", "图片编辑"