BUGFIX:aida;

This commit is contained in:
shahaibo
2024-07-02 13:48:53 +08:00
parent dd8f5696a2
commit ce384dbba9
6 changed files with 32 additions and 7 deletions

View File

@@ -3311,7 +3311,7 @@ public class PythonService {
return text;
}
public Boolean toProductImage(String url, String taskId, String prompt) {
public Boolean toProductImage(String url, String taskId, String prompt, BigDecimal imageStrength) {
// todo 限流校验
// AccessLimitUtils.validate("design",5);
OkHttpClient client = new OkHttpClient().newBuilder()
@@ -3322,12 +3322,14 @@ public class PythonService {
.build();
MediaType mediaType = MediaType.parse("application/json");
//关闭FastJson的引用检测 防止出现$ref 现象
Map<String, String> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
map.put("tasks_id", taskId);
map.put("image_url", url);
map.put("prompt", prompt);
map.put("image_strength", imageStrength);
log.info("toProductImage请求python 参数:####{}", map);
String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty);
System.out.println(param);
RequestBody body = RequestBody.create(mediaType, param);
Request request = new Request.Builder()
// .url(accessPythonIp + ":" + accessPythonPort + "/api/generate_product_image")
@@ -3370,6 +3372,7 @@ public class PythonService {
map.put("prompt", prompt);
log.info("relightImage请求python 参数:####{}", map);
String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty);
log.info(param);
RequestBody body = RequestBody.create(mediaType, param);
Request request = new Request.Builder()
// .url(accessPythonIp + ":" + accessPythonPort + "/api/generate_product_image")