[feat] 支持自定义dalle接口prompt前缀

This commit is contained in:
Wizerd
2024-01-04 22:42:00 +08:00
parent be8031342c
commit 2e0ef2bc3a
3 changed files with 10 additions and 2 deletions

View File

@@ -62,6 +62,7 @@ CUSTOM_ARKOSE = CONFIG.get('custom_arkose_url', 'false').lower() == 'true'
ARKOSE_URLS = CONFIG.get('arkose_urls', "")
DALLE_PROMPT_PREFIX = CONFIG.get('dalle_prompt_prefix', '')
# 设置日志级别
log_level_dict = {
@@ -180,9 +181,9 @@ CORS(app, resources={r"/images/*": {"origins": "*"}})
PANDORA_UPLOAD_URL = 'files.pandoranext.com'
VERSION = '0.4.3'
VERSION = '0.4.4'
# VERSION = 'test'
UPDATE_INFO = '修复各种文件生成的bug'
UPDATE_INFO = '支持自定义DALLE绘图接口prompt前缀'
# UPDATE_INFO = '【仅供临时测试使用】 '
with app.app_context():
@@ -259,6 +260,8 @@ with app.app_context():
if CUSTOM_ARKOSE:
logger.info(f"arkose_urls: {ARKOSE_URLS}")
logger.info(f"DALLE_prompt_prefix: {DALLE_PROMPT_PREFIX}")
logger.info(f"==========================================")
@@ -1583,6 +1586,8 @@ def images_generations():
prompt = data.get('prompt', '')
prompt = DALLE_PROMPT_PREFIX + prompt
# 获取请求中的response_format参数默认为"url"
response_format = data.get('response_format', 'url')