mirror of
https://github.com/Yanyutin753/RefreshToV1Api.git
synced 2025-10-18 09:04:00 +00:00
👀 支持传入size,控制画图接口输出图片的大小
This commit is contained in:
10
main.py
10
main.py
@@ -1977,12 +1977,14 @@ def images_generations():
|
|||||||
if model not in accessible_model_list and not 'gpt-4-gizmo-' in model:
|
if model not in accessible_model_list and not 'gpt-4-gizmo-' in model:
|
||||||
return jsonify({"error": "model is not accessible"}), 401
|
return jsonify({"error": "model is not accessible"}), 401
|
||||||
|
|
||||||
prompt = data.get('prompt', '')
|
|
||||||
|
|
||||||
prompt = DALLE_PROMPT_PREFIX + prompt
|
|
||||||
|
|
||||||
# 获取请求中的response_format参数,默认为"url"
|
# 获取请求中的response_format参数,默认为"url"
|
||||||
response_format = data.get('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)
|
# stream = data.get('stream', False)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user