👀 支持传入size,控制画图接口输出图片的大小

This commit is contained in:
Clivia
2024-08-07 11:35:11 +08:00
parent 8a6be9013c
commit 38a10e8f2d

10
main.py
View File

@@ -1977,12 +1977,14 @@ def images_generations():
if model not in accessible_model_list and not 'gpt-4-gizmo-' in model:
return jsonify({"error": "model is not accessible"}), 401
prompt = data.get('prompt', '')
prompt = DALLE_PROMPT_PREFIX + prompt
# 获取请求中的response_format参数默认为"url"
response_format = data.get('response_format', 'url')
# 获取请求中的size参数默认为"1024x1024"
response_size = data.get('size', '1024x1024')
prompt = data.get('prompt', '')
prompt = DALLE_PROMPT_PREFIX + '\nprompt:' + prompt + '\nsize:' + response_size
# stream = data.get('stream', False)