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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
from Util import ConfigUtil
from Util . CommonUtil import *
# 配置文件
config = ConfigUtil . getConfig ( )
# 第三方接入TOKEN
ApiToken = config [ ' api ' ] [ ' ApiToken ' ]
# 第三方接入服务器的Server地址
ApiServer = config [ ' api ' ] [ ' ApiServer ' ]
url = " https://goapi.gptnb.me/mj-relax/mj/insight-face/swap "
sourceBase64 = get_image_base64_str ( r ' ../Image/Backup/xiaoqiao.jpg ' )
targetBase64 = get_image_base64_str ( r ' ../Image/Backup/model_11_controllnet.png ' )
payload = json . dumps ( {
" sourceBase64 " : sourceBase64 , " targetBase64 " : targetBase64 ,
} )
headers = {
' User-Agent ' : ' Apifox/1.0.0 (https://apifox.com) ' ,
' Content-Type ' : ' application/json ' ,
' Authorization ' : ' Bearer ' + ApiToken
}
response = requests . request ( " POST " , url , headers = headers , data = payload )
print ( response . text )
# 1717132901220438
# 1美元一次, 简直太贵了, 无法使用! ! !
'''
2024-05-31 13:26:41 消费 littlehb的初始令牌 midjourney-relax <1秒 非流 $1 模型调用
2024-05-31 13:22:06 消费 littlehb的初始令牌 midjourney-fast <1秒 非流 $1 模型调用
'''