feat: Make the size parameter of the resulting picture configurable

This commit is contained in:
李超
2023-04-16 22:28:10 +08:00
parent 29fbf69945
commit fc5d3e4e9c
3 changed files with 8 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ class OpenAIImage(object):
response = openai.Image.create(
prompt=query, #图片描述
n=1, #每次生成图片的数量
size="256x256" #图片大小,可选有 256x256, 512x512, 1024x1024
size=conf().get('image_create_size', "256x256") #图片大小,可选有 256x256, 512x512, 1024x1024
)
image_url = response['data'][0]['url']
logger.info("[OPEN_AI] image_url={}".format(image_url))