Doubao Image Generation
This skill provides access to Volcengine's Doubao (Seedream) image generation models. It supports high-quality text-to-image generation and image editing/variation based on input images.
Usage
Use the provided Python script to generate images.
Models
- doubao-seedream-4.5: Latest model, supports text-to-image and multi-image references (2-14 images). High quality.
- doubao-seedream-4.0: Supports text-to-image and multi-image references.
- doubao-seedream-3.0-t2i: Text-to-image only.
- doubao-seededit-3.0-i2i: Image-to-image editing (single reference image).
Script: generate_image.py
Execute the script to call the API.
Arguments:
--prompt: (Required) The text description of the image to generate. Max 300 Chinese characters or 600 English words.--model: (Optional) The model ID to use. Default:doubao-seedream-4.5.--image: (Optional) Path or URL to reference image(s). Can be specified multiple times for multi-image support (only for 4.5/4.0).--width: (Optional) Width of the generated image. Default: 1024.--height: (Optional) Height of the generated image. Default: 1024.--size: (Optional) Preset size string (e.g., "1024x1024"). Overrides width/height if set.--guidance-scale: (Optional) Text guidance scale (1.0-10.0). Higher values adhere more strictly to the prompt. Default varies by model.--output: (Optional) Path to save the generated image. Default:./generated_image.png.
Example:
# Basic text-to-image
python3 scripts/generate_image.py --prompt "A futuristic city skyline at sunset, cyberpunk style"
# Image-to-image with a reference
python3 scripts/generate_image.py --prompt "Turn this into an oil painting" --image "./sketch.png" --model "doubao-seededit-3.0-i2i"
# Multi-image reference (Seedream 4.5)
python3 scripts/generate_image.py --prompt "Combine these styles" --image "./style1.jpg" --image "./style2.jpg" --model "doubao-seedream-4.5"
Requirements
- API Key: Set the
VOLCENGINE_API_KEYenvironment variable. - Python Dependencies:
requests(usually available).
