main
黄海 1 year ago
parent 77058bb990
commit 47c1cbf880

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

@ -0,0 +1,57 @@
{
"override_settings": {
"sd_model_checkpoint": "AgainMixChibi_1G_pvc.safetensors [14f479afc2]",
"sd_vae": "Automatic"
},
"prompt": "(best quality:1.4),(masterpiece:1.4),(8K:1.4),(extremely detailed:1.4),1gril,(black eyes:1.2),(black hair:1.2),beret.headphones,full body,(chibi:1.4),smile,<lora:ip-adapter-faceid-plusv2_sd15_lora:0.8>,",
"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,",
"steps": 25,
"sampler_name": "DPM++ 2M Karras",
"width": 1024,
"height": 1472,
"batch_size": 1,
"n_iter": 1,
"seed": 1,
"cfg_scale": 7,
"CLIP_stop_at_last_layers": 2,
"init_images": [
"string"
],
"restore_faces": false,
"enable_hr": true,
"denoising_strength": 0.5,
"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": true,
"input_image": "string",
"control_mode": "My prompt is more important"
},
{
"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": true,
"input_image": "string",
"control_mode": "ControlNet is more important"
}
]
}
}
}

@ -1,20 +1,21 @@
import os
from Util.CommonUtil import *
# API地址
url = "http://192.168.1.21:7860"
# 用户输入的源图
input_source_img = '../Image/1ae93e2587822c291362abf9504cb49ec.jpeg'
# 输出图片
output_file = "../Out/Result.png"
# 图生图函数
def img2img(url,model_id, prompt_id, input_source_img, output_file):
def img2img(url, model_id, prompt_id, input_source_img, output_file):
# JSON文件模板
templet_file = r'../JSON/' + str(model_id) + '_' + str(prompt_id) + '.json'
# 模型图片
input_refer_img = '../Image/' + str(model_id) + '/' + str(prompt_id) + '.jpg'
if not os.path.exists(input_refer_img):
input_refer_img = '../Image/' + str(model_id) + '/' + str(prompt_id) + '.png'
# 读取JSON文件
with open(templet_file, 'r', encoding='utf-8') as file:
payload = json.load(file)
@ -38,5 +39,10 @@ def img2img(url,model_id, prompt_id, input_source_img, output_file):
# 保存图片
save_encoded_image(response.json()['images'][0], output_file)
# 用户输入的源图
input_source_img = '../Image/1ae93e2587822c291362abf9504cb49ec.jpeg'
# 输出图片
output_file = "../Out/Result.png"
# 调用图生图
img2img(url, 28, 1, input_source_img, output_file)
img2img(url, 12, 1, input_source_img, output_file)

Loading…
Cancel
Save