From e6b7e349d9a699a29432f08b406471fcb268779b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Mon, 1 Jul 2024 08:45:20 +0800 Subject: [PATCH] 'commit' --- BaiHu/JSON/{5.json => 5_1.json} | 12 +++---- BaiHu/JSON/5_2.json | 59 +++++++++++++++++++++++++++++++++ BaiHu/JSON/5_3.json | 59 +++++++++++++++++++++++++++++++++ BaiHu/JSON/5_4.json | 59 +++++++++++++++++++++++++++++++++ BaiHu/JSON/5_5.json | 59 +++++++++++++++++++++++++++++++++ BaiHu/Tools/TestComfyUIApi.py | 30 ++++++----------- 6 files changed, 250 insertions(+), 28 deletions(-) rename BaiHu/JSON/{5.json => 5_1.json} (70%) create mode 100644 BaiHu/JSON/5_2.json create mode 100644 BaiHu/JSON/5_3.json create mode 100644 BaiHu/JSON/5_4.json create mode 100644 BaiHu/JSON/5_5.json diff --git a/BaiHu/JSON/5.json b/BaiHu/JSON/5_1.json similarity index 70% rename from BaiHu/JSON/5.json rename to BaiHu/JSON/5_1.json index 0dc0adf8..1de5075a 100644 --- a/BaiHu/JSON/5.json +++ b/BaiHu/JSON/5_1.json @@ -3,20 +3,16 @@ "memo": "【全身】", "pose_image": "", "denoising_strength": 0, - "prompts": [ - ",QIEMANCN,Chinese clothes,traditional,hanfu,a photo of woman with a green and gold dress,upper body,(details:1.1),photorealistic,RAW photo,high quality,", - ",QIEMANCN,Chinese clothes,traditional,hanfu,a photo of woman with a blue and gold dress,upper body,(details:1.1),photorealistic,RAW photo,high quality,", - ",QIEMANCN,Chinese clothes,traditional,hanfu,a photo of woman with a red and gold dress,upper body,(details:1.1),photorealistic,RAW photo,high quality," - ], + "prompt": "QIEMANCN,a photo of woman with a red and gold dress,hanfu,chinese style,grand spectacle,wide viewing angle,high definition,big scene,snowscape,plum blossom,looking at the camera,,", "negative_prompt": "(text:2),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:2),cross-eyed,", "seed": -1, "sampler_name": "DPM++ 2M Karras", "cfg_scale": 7, - "width": 1328, - "height": 1664, + "width": 1024, + "height": 1280, "batch_size": 1, "n_iter": 1, - "steps": 30, + "steps": 25, "return_grid": true, "send_images": true, "save_images": false, diff --git a/BaiHu/JSON/5_2.json b/BaiHu/JSON/5_2.json new file mode 100644 index 00000000..10b07e4a --- /dev/null +++ b/BaiHu/JSON/5_2.json @@ -0,0 +1,59 @@ +{ + "model_name": "汉服凤冠霞帔", + "memo": "【全身】", + "pose_image": "", + "denoising_strength": 0, + "prompt": "QIEMANCN,a photo of woman with a blue and gold dress,hanfu,chinese style,grand spectacle,wide viewing angle,high definition,big scene,,", + "negative_prompt": "(text:2),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:2),cross-eyed,", + "seed": -1, + "sampler_name": "DPM++ 2M Karras", + "cfg_scale": 7, + "width": 1024, + "height": 1280, + "batch_size": 1, + "n_iter": 1, + "steps": 25, + "return_grid": true, + "send_images": true, + "save_images": false, + "do_not_save_samples": false, + "do_not_save_grid": false, + "override_settings": { + "sd_model_checkpoint": "国风 - 汉服 - 写实 SDXL_v20.safetensors [9ec203c3a6]", + "sd_vae": "Automatic" + }, + "alwayson_scripts": { + "ControlNet": { + "args": [ + { + "enabled": true, + "model": "ip-adapter_instant_id_sdxl [eb2d3ec0]", + "module": "instant_id_face_embedding", + "weight": 1, + "resize_mode": "Crop and Resize", + "guidance_start": 0, + "guidance_end": 1, + "pixel_perfect": true, + "processor_res": 512, + "save_detected_map": false, + "input_image": "{{input_image1}}", + "control_mode": "Balanced" + }, + { + "enabled": true, + "model": "control_instant_id_sdxl [c5c25a50]", + "module": "instant_id_face_keypoints", + "weight": 1, + "resize_mode": "Crop and Resize", + "guidance_start": 0, + "guidance_end": 1, + "pixel_perfect": true, + "processor_res": 512, + "save_detected_map": false, + "input_image": "{{input_image2}}", + "control_mode": "ControlNet is more important" + } + ] + } + } +} \ No newline at end of file diff --git a/BaiHu/JSON/5_3.json b/BaiHu/JSON/5_3.json new file mode 100644 index 00000000..c5cdd527 --- /dev/null +++ b/BaiHu/JSON/5_3.json @@ -0,0 +1,59 @@ +{ + "model_name": "汉服凤冠霞帔", + "memo": "【全身】", + "pose_image": "", + "denoising_strength": 0, + "prompt": "QIEMANCN,a photo of woman with a red and gold dress,open eye,full body,hanfu,chinese style,,", + "negative_prompt": "(text:2),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:2),cross-eyed,", + "seed": -1, + "sampler_name": "DPM++ 2M Karras", + "cfg_scale": 7, + "width": 1024, + "height": 1280, + "batch_size": 1, + "n_iter": 1, + "steps": 25, + "return_grid": true, + "send_images": true, + "save_images": false, + "do_not_save_samples": false, + "do_not_save_grid": false, + "override_settings": { + "sd_model_checkpoint": "国风 - 汉服 - 写实 SDXL_v20.safetensors [9ec203c3a6]", + "sd_vae": "Automatic" + }, + "alwayson_scripts": { + "ControlNet": { + "args": [ + { + "enabled": true, + "model": "ip-adapter_instant_id_sdxl [eb2d3ec0]", + "module": "instant_id_face_embedding", + "weight": 1, + "resize_mode": "Crop and Resize", + "guidance_start": 0, + "guidance_end": 1, + "pixel_perfect": true, + "processor_res": 512, + "save_detected_map": false, + "input_image": "{{input_image1}}", + "control_mode": "Balanced" + }, + { + "enabled": true, + "model": "control_instant_id_sdxl [c5c25a50]", + "module": "instant_id_face_keypoints", + "weight": 1, + "resize_mode": "Crop and Resize", + "guidance_start": 0, + "guidance_end": 1, + "pixel_perfect": true, + "processor_res": 512, + "save_detected_map": false, + "input_image": "{{input_image2}}", + "control_mode": "ControlNet is more important" + } + ] + } + } +} \ No newline at end of file diff --git a/BaiHu/JSON/5_4.json b/BaiHu/JSON/5_4.json new file mode 100644 index 00000000..1251ec42 --- /dev/null +++ b/BaiHu/JSON/5_4.json @@ -0,0 +1,59 @@ +{ + "model_name": "汉服凤冠霞帔", + "memo": "【全身】", + "pose_image": "", + "denoising_strength": 0, + "prompt": "QIEMANCN,a photo of woman with a red and gold dress,open eye,full body,hanfu,chinese style,the background is the red wall of the forbidden city,grand spectacle,,", + "negative_prompt": "(text:2),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:2),cross-eyed,", + "seed": -1, + "sampler_name": "DPM++ 2M Karras", + "cfg_scale": 7, + "width": 1024, + "height": 1280, + "batch_size": 1, + "n_iter": 1, + "steps": 25, + "return_grid": true, + "send_images": true, + "save_images": false, + "do_not_save_samples": false, + "do_not_save_grid": false, + "override_settings": { + "sd_model_checkpoint": "国风 - 汉服 - 写实 SDXL_v20.safetensors [9ec203c3a6]", + "sd_vae": "Automatic" + }, + "alwayson_scripts": { + "ControlNet": { + "args": [ + { + "enabled": true, + "model": "ip-adapter_instant_id_sdxl [eb2d3ec0]", + "module": "instant_id_face_embedding", + "weight": 1, + "resize_mode": "Crop and Resize", + "guidance_start": 0, + "guidance_end": 1, + "pixel_perfect": true, + "processor_res": 512, + "save_detected_map": false, + "input_image": "{{input_image1}}", + "control_mode": "Balanced" + }, + { + "enabled": true, + "model": "control_instant_id_sdxl [c5c25a50]", + "module": "instant_id_face_keypoints", + "weight": 1, + "resize_mode": "Crop and Resize", + "guidance_start": 0, + "guidance_end": 1, + "pixel_perfect": true, + "processor_res": 512, + "save_detected_map": false, + "input_image": "{{input_image2}}", + "control_mode": "ControlNet is more important" + } + ] + } + } +} \ No newline at end of file diff --git a/BaiHu/JSON/5_5.json b/BaiHu/JSON/5_5.json new file mode 100644 index 00000000..10b07e4a --- /dev/null +++ b/BaiHu/JSON/5_5.json @@ -0,0 +1,59 @@ +{ + "model_name": "汉服凤冠霞帔", + "memo": "【全身】", + "pose_image": "", + "denoising_strength": 0, + "prompt": "QIEMANCN,a photo of woman with a blue and gold dress,hanfu,chinese style,grand spectacle,wide viewing angle,high definition,big scene,,", + "negative_prompt": "(text:2),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:2),cross-eyed,", + "seed": -1, + "sampler_name": "DPM++ 2M Karras", + "cfg_scale": 7, + "width": 1024, + "height": 1280, + "batch_size": 1, + "n_iter": 1, + "steps": 25, + "return_grid": true, + "send_images": true, + "save_images": false, + "do_not_save_samples": false, + "do_not_save_grid": false, + "override_settings": { + "sd_model_checkpoint": "国风 - 汉服 - 写实 SDXL_v20.safetensors [9ec203c3a6]", + "sd_vae": "Automatic" + }, + "alwayson_scripts": { + "ControlNet": { + "args": [ + { + "enabled": true, + "model": "ip-adapter_instant_id_sdxl [eb2d3ec0]", + "module": "instant_id_face_embedding", + "weight": 1, + "resize_mode": "Crop and Resize", + "guidance_start": 0, + "guidance_end": 1, + "pixel_perfect": true, + "processor_res": 512, + "save_detected_map": false, + "input_image": "{{input_image1}}", + "control_mode": "Balanced" + }, + { + "enabled": true, + "model": "control_instant_id_sdxl [c5c25a50]", + "module": "instant_id_face_keypoints", + "weight": 1, + "resize_mode": "Crop and Resize", + "guidance_start": 0, + "guidance_end": 1, + "pixel_perfect": true, + "processor_res": 512, + "save_detected_map": false, + "input_image": "{{input_image2}}", + "control_mode": "ControlNet is more important" + } + ] + } + } +} \ No newline at end of file diff --git a/BaiHu/Tools/TestComfyUIApi.py b/BaiHu/Tools/TestComfyUIApi.py index 53071f3f..884afe14 100644 --- a/BaiHu/Tools/TestComfyUIApi.py +++ b/BaiHu/Tools/TestComfyUIApi.py @@ -20,6 +20,15 @@ def queue_prompt(server_address, client_id, prompt): print(err) return json.loads(urllib.request.urlopen(req).read()) + +''' +vram_total # 显存容量:25756696576 即24GB +vram_free # 显存剩余:25756696576 +torch_vram_total 16005464064 +torch_vram_free 331041996 +''' + + def getUse(server_address): req = urllib.request.Request("http://{}/system_stats".format(server_address)) res = json.loads(urllib.request.urlopen(req).read()) @@ -31,10 +40,7 @@ def getUse(server_address): used_vram_str = str(int((vram_total - vram_free) / 1024 / 1024 / 1024 + 0.5)) used_lv = round(1.0 * (used_vram) / vram_total * 100, 2) print("显存共:" + vram_total_str + "GB,已使用:" + used_vram_str + "GB,使用率:" + str(used_lv) + "% ") - # vram_total # 显存容量:25756696576 即24GB - # vram_free # 显存剩余:25756696576 - # torch_vram_total 16005464064 - # torch_vram_free 331041996 + # GET /system_stats # 系统统计信息接口 @@ -53,23 +59,7 @@ with open(file_path, 'r', encoding='utf-8') as file: # 如何清空Comfyui的gpu缓存 # https://wailikeji.blog.csdn.net/article/details/140035515 - # queue_prompt(server_address, "cleanGpuRam", content) # https://comfy.icu/node/easy-clearCacheAll # https://github.com/comfyanonymous/ComfyUI/issues/3615 -# Is there a way to clear the memory (VRAM) after a workflow run? -# There's an API route for it (post /free with { "unload_models": true, "free_memory": true }, and Swarm has a button in the Server tab for that. I don't think comfy itself currently has a button for it - # https://github.com/yolain/ComfyUI-Easy-Use/issues/124 -p = {"prompt": {"unload_models": True, "free_memory": True}, "client_id": "cleanGpuRam"} -data = json.dumps(p).encode('utf-8') -req = urllib.request.Request("http://{}/free".format(server_address), data=data) -print(urllib.request.urlopen(req).read()) -# https://github.com/yolain/ComfyUI-Easy-Use -# ComfyUI-Easy-Use 插件 -# https://www.runcomfy.com/comfyui-nodes/ComfyUI-Easy-Use/easy-cleanGpuUsed - -# https://www.yunrobot.cn/showdoc/web/#/641840309/231516860 - -# https://www.reddit.com/r/comfyui/comments/1cdhz5v/best_way_to_clear_vram_after_each_generation/ -