status_code=500, not supported model for image generation, only imagen models ar...
错误信息
status_code=500, not supported model for image generation, only imagen models are supported
AI 解决方案
🔍 错误分析
1. 🌐 错误翻译
原文:status_code=500, not supported model for image generation, only imagen models are supported
译文:状态码=500,图像生成不支持该模型,仅支持imagen模型
2. 🎯 原因分析
3. 💡 解决方案
确保使用平台支持的imagen系列模型,以下是正确调用示例:
import requests
url = "https://api.dmxapi.com/v1/images/generations"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
# 仅使用支持的imagen模型,如imagen-3.0或具体支持的版本
"model": "imagen-3.0",
"prompt": "一只可爱的橘猫在阳光下玩耍",
"parameters": {
"width": 1024,
"height": 1024,
"num_images": 1
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
注:需替换
YOUR_API_KEY为实际密钥,模型名称需严格参考平台支持的imagen系列模型名称。