diff --git a/BaiHu/JSON/28_1.json b/BaiHu/JSON/28_1.json index 02e8ba57..b68b9dd3 100644 --- a/BaiHu/JSON/28_1.json +++ b/BaiHu/JSON/28_1.json @@ -2,29 +2,23 @@ "prompt": "(8k, RAW photo, highest quality),hyperrealistic abstract style portrait of an otherworldly being with metallic skin,glowing orbs for eyes,and intricate fractal patterns emanating from their face,non-representational,colors and shapes,expression of feelings,imaginative,highly detailed,(pink Fluorescent eyeshadow:1.2),eyeliner,makeup,lipstick,watery eyes,(Mole under eye:1.2),(seductive_smile:1.2),XURE Dunhuang Flying XL,1girl,,", "negative_prompt": "NSFW,blurry,low quality,watermark,monochrome,badhandv4,easynegative,ng_deepnegative_v1_75t,bad proportions,mutated hands and fingers,poorly drawn face,extra limb,missing limb,malformed limbs,disconnected limbs,ugly,floating limbs,extra legs,mutation,bad body,long neck,cross-eyed,text,cleavage,", "seed": -1, + "styles": [ + + ], "sampler_name": "DPM++ 2M Karras", "batch_size": 1, "n_iter": 1, - "steps": 20, + "steps": 30, "cfg_scale": 3, "width": 1024, "height": 1472, - "restore_faces": true, - "tiling": true, + "restore_faces": false, "do_not_save_samples": false, "do_not_save_grid": false, - "eta": 0, "denoising_strength": 0.5, - "s_min_uncond": 0, - "s_churn": 0, - "s_tmax": 0, - "s_tmin": 0, - "s_noise": 0, + "s_noise": 1, "override_settings": {}, "override_settings_restore_afterwards": true, - "refiner_switch_at": 0, - "disable_extra_networks": false, - "comments": {}, "init_images": [ "string" ], @@ -33,10 +27,8 @@ "inpainting_fill": 0, "inpaint_full_res": true, "inpaint_full_res_padding": 0, - "inpainting_mask_invert": 0, "initial_noise_multiplier": 0, "include_init_images": false, - "script_args": [], "send_images": true, "save_images": false } \ No newline at end of file diff --git a/BaiHu/Test/Test.py b/BaiHu/Test/Test.py index 6a765d33..01a399df 100644 --- a/BaiHu/Test/Test.py +++ b/BaiHu/Test/Test.py @@ -1,2 +1,57 @@ -if __name__ == '__main__': - print("bbbb") \ No newline at end of file +import json +import requests +import io +import base64 +from PIL import Image +import cv2 + +url = "http://192.168.1.21:7860" + +prompt = "(8k, RAW photo, highest quality),hyperrealistic abstract style portrait of an otherworldly being with metallic skin,glowing orbs for eyes,and intricate fractal patterns emanating from their face,non-representational,colors and shapes,expression of feelings,imaginative,highly detailed,(pink Fluorescent eyeshadow:1.2),eyeliner,makeup,lipstick,watery eyes,(Mole under eye:1.2),(seductive_smile:1.2),XURE Dunhuang Flying XL,1girl,," +negative_prompt = "NSFW,blurry,low quality,watermark,monochrome,badhandv4,easynegative,ng_deepnegative_v1_75t,bad proportions,mutated hands and fingers,poorly drawn face,extra limb,missing limb,malformed limbs,disconnected limbs,ugly,floating limbs,extra legs,mutation,bad body,long neck,cross-eyed,text,cleavage," + +# 此处为读取一张图片作为输入图像 +img = cv2.imread('../Image/28/1.jpg') + +# 编码图像 +retval, bytes = cv2.imencode('.jpg', img) +encoded_image = base64.b64encode(bytes).decode('utf-8') + +payload = { + + # 模型设置 + "override_settings": { + "sd_model_checkpoint": "绪儿-一青十色XL_V2 VAE.safetensors [9f9290ac66]", + "sd_vae": "Automatic" + }, + + # 基本参数 + "prompt": prompt, + "negative_prompt": negative_prompt, + "steps": 30, + "sampler_name": "Euler a", + "width": 1024, + "height": 1472, + "batch_size": 1, + "n_iter": 1, + "seed": 1, + "cfg_scale": 3, + "CLIP_stop_at_last_layers": 2, + "init_images": [encoded_image], + # 面部修复 face fix + "restore_faces": False, + + # 高清修复 highres fix + # "enable_hr": True, + "denoising_strength": 0.5, + # "hr_scale": 2, + # "hr_upscaler": "Latent", + +} + +response = requests.post(url=f'{url}/sdapi/v1/img2img', json=payload) +r = response.json() +image = Image.open(io.BytesIO(base64.b64decode(r['images'][0]))) + +image.show() +image.save('output.png') diff --git a/BaiHu/Test/output.png b/BaiHu/Test/output.png new file mode 100644 index 00000000..b730a4fb Binary files /dev/null and b/BaiHu/Test/output.png differ