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.

57 lines
1.3 KiB

import requests
from Util.AesUtil import *
from Util.CommonUtil import set_http_proxy
from Util.PgUtil import *
# 模型名称
model_name = '真人转动漫'
# 模板类型
# 1:SD TXT2IMG 2:SD IMG2IMG 3:COMFY_UI 4:真人转动漫
model_type_id = 4
'''
1 卡通风格
2 儿童摄影
3 风格写真
4 真人转动漫
'''
style_id = 4
# 是不是封面
is_cover = 0
# 提示信息
memo = '1、上传正面半身照。 2、确保脸部无遮挡。3、正常手机拍照即可。'
# 星级
star = 5
# 上传照片数量
img_count = 1
if __name__ == '__main__':
# 禁止代理
set_http_proxy("")
# 配置文件
config = ConfigUtil.getConfig()
# 处理机编号
machine_id = config['system']['machine_id']
# 获取签名
en_data = getenData(machine_id)
# WEB服务器地址
web_url = config['webServer']['web_url']
# 请求的地址
url = web_url + '/QingLong/HuiYa/addModel'
# 要发送的数据,可以是字典形式
data = {
"enData": en_data,
"model_name": model_name,
"memo": memo,
"star": star,
"img_count": img_count,
"model_type_id": model_type_id,
"style_id": style_id,
"is_cover": is_cover
}
# 发送POST请求
response = requests.post(url, data=data)
print(response.text)