通过选择与您的工作流程匹配的请求格式,使用 CometAPI 图像模型文档。OpenAI 兼容的图像端点覆盖常见的生成和编辑流程;特定提供商页面则覆盖基于任务的图像系统。Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
选择一个图像 API
Image Generations
使用 OpenAI 兼容的请求生成图像。
Image Editing
使用 OpenAI 兼容的请求编辑图像。
Gemini image generation
使用 Gemini 格式生成或编辑图像。
Midjourney quick start
提交并轮询 Midjourney 图像任务。
Flux Generate Image
通过 CometAPI 生成 Flux 图像。
Bria Generate Image
使用 Bria 图像生成工具。
生成图像
从 Models page 或 model directory 中选择一个支持图像的 model ID。下面的示例调用 OpenAI 兼容的 Image Generations API。这些示例使用占位符
your-image-model-id。在运行请求之前,请将其替换为 Models page 或 model directory 中可用的图像 model ID。响应示例
成功响应可能如下所示。根据所选模型,每个条目可以包含 base64 图像或结果 URL:示例 model 记录
这个示例模型目录响应展示了
/api/models 封装和一种图像 model 记录的形状。它不是完整的模型列表。cURL
常见错误
无效的 model ID
无效的 model ID
从 Models page 中选择一个支持图像的 model。
不支持的尺寸
不支持的尺寸
使用所选图像端点接受的尺寸。
结果 URL 已过期
结果 URL 已过期
在提供商链接过期之前下载生成的资源。
上传过大
上传过大
使用图像 URL 或更小的文件,而不是大型 base64 负载。
缺少图像数据
缺少图像数据
同时检查
b64_json 和 url 字段,因为输出结构可能因 model 而异。错误代码和重试策略
400
400
在修复 Prompt、尺寸或图像输入之前不要重试。
401
401
在 API key 存在且有效之前不要重试。
404
404
重试前检查基础 URL、路径和 model ID。
413
413
重试前减小上传大小。
429
429
使用指数退避重试,并降低并发。
500 or 503
500 or 503
对临时的提供商或服务错误使用退避重试。
定价和 model 目录
Models page
阅读 CometAPI 如何在文档中公开 model ID。
Model directory
浏览 model 可用性和能力。
Pricing
在调用 model 之前查看定价。