You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
from datetime import datetime
|
|
|
|
from Util import ConfigUtil
|
|
from Util import MjUtil
|
|
from Util.Logger import *
|
|
|
|
if __name__ == '__main__':
|
|
# 配置文件
|
|
config = ConfigUtil.getConfig()
|
|
# 第三方接入TOKEN
|
|
ApiToken = config['api']['ApiToken']
|
|
# 第三方接入服务器的Server地址
|
|
ApiServer = config['api']['ApiServer']
|
|
|
|
# 绘鸭的Stable Diffusion 日志文件
|
|
LOG_SD = Logger('../Log/HuiYa_SD.log', level='debug')
|
|
log_sd = LOG_SD.logger
|
|
# 绘鸭的Midjourney日志文件
|
|
LOG_MJ = Logger('../Log/HuiYa_MJ.log', level='debug')
|
|
log_mj = LOG_MJ.logger
|
|
|
|
# 使用代理下载这个图片
|
|
current_time = datetime.now()
|
|
timestamp = current_time.strftime('%Y%m%d%H%M%S')
|
|
filePath = 'Out/' + str(timestamp) + '.png' # 定义保存文件的路径
|
|
# 1717122628315738
|
|
taskId = 1717246589651169
|
|
ret = MjUtil.try_down_mj_img(ApiToken, taskId, filePath, log_mj)
|
|
|
|
if ret[0]:
|
|
res = MjUtil.split_4_image(filePath, 'Out')
|
|
log_mj.info(res)
|
|
else:
|
|
log_mj.info(ret[1])
|