'commit'
This commit is contained in:
Binary file not shown.
@@ -1,9 +1,8 @@
|
|||||||
import os
|
|
||||||
import logging
|
|
||||||
import requests
|
|
||||||
import json
|
import json
|
||||||
import time
|
import logging
|
||||||
from pathlib import Path
|
import os
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
from Config import Config
|
from Config import Config
|
||||||
|
|
||||||
@@ -13,10 +12,6 @@ logger = logging.getLogger('MjCommon')
|
|||||||
|
|
||||||
|
|
||||||
class MjCommon:
|
class MjCommon:
|
||||||
# 获取项目根目录路径
|
|
||||||
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "..", ".."))
|
|
||||||
# 拼接相对路径
|
|
||||||
base_path = os.path.join(project_root, "src", "main", "python", "com", "dsideal", "aiSupport", "Util", "Midjourney", "Example")
|
|
||||||
|
|
||||||
ak = Config.GPTNB_API_KEY
|
ak = Config.GPTNB_API_KEY
|
||||||
BASE_URL = Config.GPTNB_BASE_URL
|
BASE_URL = Config.GPTNB_BASE_URL
|
||||||
|
BIN
dsLightRag/Midjourney/Kit/__pycache__/MjCommon.cpython-310.pyc
Normal file
BIN
dsLightRag/Midjourney/Kit/__pycache__/MjCommon.cpython-310.pyc
Normal file
Binary file not shown.
@@ -141,7 +141,7 @@ class Txt2Img(MjCommon):
|
|||||||
# 生成文件名(使用时间戳和任务ID)
|
# 生成文件名(使用时间戳和任务ID)
|
||||||
file_name = f"mj_{int(time.time() * 1000)}_{task_id}.png"
|
file_name = f"mj_{int(time.time() * 1000)}_{task_id}.png"
|
||||||
# 完整保存路径
|
# 完整保存路径
|
||||||
save_path = os.path.join(MjCommon.base_path, file_name)
|
save_path = os.path.join("d:/", file_name)
|
||||||
# 下载图片
|
# 下载图片
|
||||||
MjCommon.download_file(image_url, save_path)
|
MjCommon.download_file(image_url, save_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
BIN
dsLightRag/Midjourney/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
dsLightRag/Midjourney/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
Reference in New Issue
Block a user