إنشاء صور Seedream
استخدم مسار CometAPI POST /v1/images/generations لإنشاء صور Seedream باستخدام prompts نصية، وصور مرجعية، وإخراج صور متسلسل، ومهام async.
POST /v1/images/generations لتشغيل إنشاء صور Seedream. تدعم نقطة النهاية هذه طلبات text-to-image، وطلبات الصور المرجعية، وإخراج الصور المتسلسل المحدود عندما يدعم model المحدد هذه العناصر التحكّمية.
تغطي هذه الصفحة seedream-5-0-pro-260628 لطلبات Pro من نوع text-to-image وseedream-5-0-260128 لأمثلة الصور المرجعية والمتسلسلة وasync في Seedream 5.0. لمعرفة التوفر في الحساب، راجع صفحة Models أو استعلم عن /v1/models. وللاطلاع على تفاصيل parameters الخاصة بالموفّر، راجع image generation API من BytePlus ودليل Seedream 4.0-5.0.
اختر شكل الطلب
- Text to image: أرسل
modelوpromptوsizeوعناصر تحكم اختيارية في الإخراج مثلresponse_formatوoutput_formatوwatermark. - Image to image: أضف
imageكمصفوفة من عناوين URL عامة عبر HTTPS أو data URI. استخدم مصفوفة حتى عند إرسال صورة مرجعية واحدة. - Sequential prompt: اضبط
sequential_image_generationعلىautoواستخدمsequential_image_generation_options.max_imagesكحد أقصى. يمكن أن يعيد model صورًا أقل من الحد الأقصى. - Async task: أضف
async: trueعندما تريد أن يعيد طلب الإنشاءdata.task_idبدلًا من إبقاء اتصال HTTP مفتوحًا.
max_images.شغّل مهمة صورة async
اضبطasync على true للمهام الصورية التي ينبغي على العميل إرسالها ثم الاستعلام عنها. يعيد طلب الإنشاء data.task_id؛ استخدم هذه القيمة مع استرجاع مهمة صورة Seedream حتى تصبح data.status مساوية لـ success أو failure.
استخدم 2K في أمثلة async لطلبات Seedream 5.0. يختلف دعم الأحجام حسب model ID، لذا اختر حجمًا مدعومًا من model قبل إرسال مهمة async.
أرسل صورًا مرجعية
استخدمdata:image/png;base64,YOUR_BASE64_IMAGE لبيانات الصور المضمّنة، أو استخدم عنوان URL عامًا عبر HTTPS يمكن للموفّر الوصول إليه. تعرض أمثلة مرجع API شكل JSON الكامل لكل نوع من الطلبات.
اقرأ عناوين URL الخاصة بالمخرجات
التفويضات
Bearer token authentication. Use your CometAPI key.
الجسم
Parameters for Seedream image generation. Send JSON for text-to-image, image-to-image, and sequential prompt requests.
Seedream model ID to use. Query /v1/models or open the Models page for available model IDs.
Text prompt describing the image or edit goal. Use a concrete visual request, such as a blue ceramic mug on a white table, soft studio lighting.
Response image format. Use url for a temporary signed image URL, or b64_json when you need base64 image data in the response.
url, b64_json Output resolution. Use a model-supported tier such as 2K or a model-supported WIDTHxHEIGHT value such as 2048x2048. Not every model ID accepts every tier.
Optional reference images for image-to-image generation. Each item can be a public HTTPS URL or a data URI such as data:image/png;base64,YOUR_BASE64_IMAGE. Use an array even for one image. Reference images plus generated images must not exceed the provider limit.
When true, requests a visible AI-generated watermark on the output image. Set false when your workflow handles disclosure separately.
CometAPI asynchronous task mode. Set this to true to return immediately with data.task_id, then poll the Seedream image task endpoint GET /v1/images/generations/{task_id} for the final image data.
Output image file format. Use png when you need lossless output, or jpeg for smaller files.
png, jpeg Optional prompt-adherence control for model versions that support it. Higher values can follow the prompt more closely but may reduce naturalness. Omit this field when you do not need model-specific tuning.
1 <= x <= 10Optional random seed for reproducible attempts on model versions that support seeding. Use -1 or omit the field for a random seed.
-1 <= x <= 2147483647Controls sequential prompt handling. Use auto to let the model return a sequence when the prompt calls for one. Use disabled for ordinary single-image requests.
auto, disabled Options for sequential prompt handling. This object is only used when sequential_image_generation is auto.
الاستجابة
Image generation response. Synchronous requests return completed image data. Async requests return a task response with data.task_id.
- Option 1
- Async task response