main
黄海 1 year ago
parent a421f2301e
commit 784cc4cdf4

@ -5,22 +5,22 @@ from Util.PgUtil import *
# 模型名称
model_name = '海的女儿'
model_name = '真人转动漫'
# 模板类型
# 1:SD TXT2IMG 2:SD IMG2IMG 3:COMFY_UI
model_type_id = 2
# 1:SD TXT2IMG 2:SD IMG2IMG 3:COMFY_UI 4:真人转动漫
model_type_id = 4
'''
1 卡通风格
2 儿童摄影
3 风格写真
4 双人系列
4 真人转动漫
'''
style_id = 2
style_id = 4
# 是不是封面
is_cover = 1
is_cover = 0
# 提示信息
memo = '1、请上传正面半身照。; 2、确保脸部无遮挡3、图片要求不小于1.5MB(正常手机拍照即可)'
memo = '1、上传正面半身照。 2、确保脸部无遮挡。3、正常手机拍照即可。'
# 星级
star = 5
# 上传照片数量

@ -136,7 +136,8 @@ def webui_convert(model_id, json_data, input_image, target_folder):
# 2、需要获取原始图片的大小
img = Image.open(input_image[0])
width = img.size[0], height = img.size[1]
width = img.size[0]
height = img.size[1]
img.close()
# 然后需要干点啥?

@ -285,12 +285,11 @@ public class HuiYaController extends Controller {
* @param model_id ID
* @param prompt_id ID
* @param source_img_url url
* @param images_md5 MD5
*/
@Before({POST.class})
@EmptyInterface({"token", "source_img_url"})
@IsNumericInterface({"model_id", "count"})
public void wxAddTask(String token, int model_id, String source_img_url, String images_md5, int prompt_id) {
public void wxAddTask(String token, int model_id, String source_img_url, int prompt_id) {
if (prompt_id == 0) prompt_id = 1;
//验证token
Kv res = ym.checkToken(token);
@ -401,6 +400,28 @@ public class HuiYaController extends Controller {
renderJson(res);
}
/**
*
*
* @param token
*/
@Before({POST.class})
@EmptyInterface({"token"})
public void wxGetConvertChildModel(String token) {
//验证token
Kv res = ym.checkToken(token);
if (!res.getBoolean("success")) {
Kv kv = Kv.by("success", false);
kv.set("message", res.getStr("message"));
renderJson(kv);
return;
}
List<Record> list = ym.wxGetConvertChildModel();
res.set("data", list);
renderJson(res);
}
/**
*
*

@ -666,4 +666,21 @@ public class HuiYaModel {
wxAddJournal(user_id, 1, 0, 0, jd_count, before_jd_count, after_jd_count, "管理员授于,获得金豆" + jd_count + "个。");
}
/**
* prompt_id,
*
* @return
*/
public List<Record> wxGetConvertChildModel() {
String sql = "select * from t_hy_convert order by prompt_id";
List<Record> list = Db.find(sql);
String prefix = "http://hzkc.oss-cn-beijing.aliyuncs.com/Images/System/49/";
for (Record record : list) {
int prompt_id = record.getInt("prompt_id");
record.set("view_before_img_url", prefix + prompt_id + "_1.png");
record.set("view_after_img_url", prefix + prompt_id + "_2.png");
}
return list;
}
}

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

@ -7,7 +7,7 @@
#end
-- 获取推荐模型列表
#sql("wxGetTjModelList")
select t1.* from t_hy_model as t1 where t1.b_use=1 and t1.is_cover = 1
select t1.* from t_hy_model as t1 where t1.b_use=1 and t1.style_id in (1,2,3) and t1.is_cover = 1
order by t1.star desc,t1.model_id desc
#end
-- 获取指定用户的图片列表

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save