1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/seedream-4";
const data = {
"size": "2K",
"width": 2048,
"height": 2048,
"prompt": "Action hero into an apocalypse survivor zombie hunter, torn leather jacket with spikes, glowing red cybernetic eye, dual chainsaw weapons, burning city ruins background, blood splatter effects, horror movie aesthetic, badass energy, ultra-detailed gore",
"max_images": 1,
"image_input": "https://segmind-resources.s3.amazonaws.com/input/ee043397-b857-4bf2-9ad0-70258a286e96-504cf296-f8c3-40af-b200-9b52bdae240c.png",
"aspect_ratio": "match_input_image",
"sequential_image_generation": "disabled"
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
Specifies image resolution. Use '2K' for standard images, '4K' for high-res, 'custom' for unique needs.
Allowed values:
Defines width when size is 'custom'. Use 1024 for thumbnails, 4096 for detailed art.
min : 1024,
max : 4096
Defines height when size is 'custom'. Set 1024 for small images, 4096 for large posters.
min : 1024,
max : 4096
Text describing the image to generate. Include subjects like 'sunset mountain view'.
Sets image generation limit. Choose 1 for single outcome, 5 for multiple.
min : 1,
max : 15
List of image URLs to guide generation. Use for reference; add 1-3 URLs.
Determines image proportions. Select '16:9' for widescreen, '1:1' for square format.
Allowed values:
Controls image creation order. Enable 'auto' for batch generation, 'disabled' otherwise.
Allowed values:
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Seedream 4.0 is a high-performance AI image generation model that effectively creates visuals at par with professional-level creative fidelity and renders the text with equal veracity. It is integrated into an improved text-to-image model to generate visuals that are realistic. With its 4K resolution, the model excels at creating complex visuals such as posters, marketing graphics, infographics, and elaborate digital art while maintaining clarity, sharpness, and integrity in design. Seedream 4.0 offers professional-grade AI visuals, making it a highly dependable option for designers and teams in other creative fields who desire the necessary control over the workflow.
How is Seedream 4.0 different from other text-to-image models?
Seedream 4.0 excels in generating high-resolution images with impressive accuracy in text rendering and layout design, making it ideal for professional design projects and marketing materials.
What's the maximum resolution supported?
Seedream 4.0 supports custom resolutions up to 4096×4096 pixels (4K), with flexible aspect ratio options to render various use cases.
Can I use reference images to guide the generation?
Yes, you can upload up to three reference images to moderate the visuals’ style, composition, and specific elements.
How many images can I generate in one prompt?
You can generate up to 15 images per prompt using the max_images parameter option. It also has the support to execute sequential or batch generation.
What file formats and sizes work best for reference images?
Standard image formats (PNG, JPEG) work well as reference images. For best results, use high-quality images that depict your desired style or composition elements.