Browse Source

feature-img-1.0:待加入翻译api

feature-1.0-img
Penny 3 years ago
parent
commit
f8c1dca3e7
  1. 2
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/StableDiffusionServiceImpl.java

2
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/StableDiffusionServiceImpl.java

@ -68,7 +68,7 @@ public class StableDiffusionServiceImpl implements StableDiffusionService {
map.put("steps",25);
map.put("negative_prompt","nsfw");
log.info("请求stable_diffusion请求体为:【{}】", JSON.toJSONString(map));
JSONObject jsonObject = restTemplate.postForObject("http://124.220.2.237:7860/sdapi/v1/txt2img", map, JSONObject.class);
JSONObject jsonObject = restTemplate.postForObject("http://localhost:7860/sdapi/v1/txt2img", map, JSONObject.class);
log.info("请求stable_diffusion响应体的为:【{}】", JSON.toJSONString(jsonObject));
TextToImgVo img = new TextToImgVo();
if(jsonObject != null && jsonObject.getJSONArray("images").size() > 0){

Loading…
Cancel
Save