FaceID v2

This commit is contained in:
matt3o
2023-12-30 20:30:40 +01:00
parent a09f541184
commit 3e80c92149
6 changed files with 1689 additions and 1004 deletions
+45 -13
View File
@@ -122,12 +122,14 @@ class ProjModelFaceIdPlus(torch.nn.Module):
ff_mult=4,
)
def forward(self, id_embeds, clip_embeds):
def forward(self, id_embeds, clip_embeds, scale=1.0, shortcut=False):
x = self.proj(id_embeds)
x = x.reshape(-1, self.num_tokens, self.cross_attention_dim)
x = self.norm(x)
x = self.perceiver_resampler(x, clip_embeds)
return x
out = self.perceiver_resampler(x, clip_embeds)
if shortcut:
out = x + scale * out
return out
class ImageProjModel(nn.Module):
def __init__(self, cross_attention_dim=1024, clip_embeddings_dim=1024, clip_extra_context_tokens=4):
@@ -320,8 +322,8 @@ class IPAdapter(nn.Module):
return image_prompt_embeds, uncond_image_prompt_embeds
@torch.inference_mode()
def get_image_embeds_faceid_plus(self, face_embed, clip_embed):
embeds = self.image_proj_model(face_embed, clip_embed)
def get_image_embeds_faceid_plus(self, face_embed, clip_embed, s_scale, shortcut):
embeds = self.image_proj_model(face_embed, clip_embed, scale=s_scale, shortcut=shortcut)
return embeds
class CrossAttentionPatch:
@@ -486,7 +488,6 @@ class IPAdapterModelLoader:
RETURN_TYPES = ("IPADAPTER",)
FUNCTION = "load_ipadapter_model"
CATEGORY = "ipadapter"
def load_ipadapter_model(self, ipadapter_file):
@@ -519,7 +520,6 @@ class InsightFaceLoader:
RETURN_TYPES = ("INSIGHTFACE",)
FUNCTION = "load_insight_face"
CATEGORY = "ipadapter"
def load_insight_face(self, provider):
@@ -551,7 +551,6 @@ class IPAdapterApply:
},
"optional": {
"attn_mask": ("MASK",),
"insightface": ("INSIGHTFACE",),
}
}
@@ -559,7 +558,7 @@ class IPAdapterApply:
FUNCTION = "apply_ipadapter"
CATEGORY = "ipadapter"
def apply_ipadapter(self, ipadapter, model, weight, clip_vision=None, image=None, weight_type="original", noise=None, embeds=None, attn_mask=None, start_at=0.0, end_at=1.0, unfold_batch=False, insightface=None):
def apply_ipadapter(self, ipadapter, model, weight, clip_vision=None, image=None, weight_type="original", noise=None, embeds=None, attn_mask=None, start_at=0.0, end_at=1.0, unfold_batch=False, insightface=None, faceid_v2=False, weight_v2=False):
self.dtype = torch.float16 if comfy.model_management.should_use_fp16() else torch.float32
self.device = comfy.model_management.get_torch_device()
self.weight = weight
@@ -649,8 +648,8 @@ class IPAdapterApply:
self.ipadapter.to(self.device, dtype=self.dtype)
if self.is_faceid and self.is_plus:
image_prompt_embeds = self.ipadapter.get_image_embeds_faceid_plus(face_embed.to(self.device, dtype=self.dtype), clip_embed.to(self.device, dtype=self.dtype))
uncond_image_prompt_embeds = self.ipadapter.get_image_embeds_faceid_plus(face_embed_zeroed.to(self.device, dtype=self.dtype), clip_embed_zeroed.to(self.device, dtype=self.dtype))
image_prompt_embeds = self.ipadapter.get_image_embeds_faceid_plus(face_embed.to(self.device, dtype=self.dtype), clip_embed.to(self.device, dtype=self.dtype), weight_v2, faceid_v2)
uncond_image_prompt_embeds = self.ipadapter.get_image_embeds_faceid_plus(face_embed_zeroed.to(self.device, dtype=self.dtype), clip_embed_zeroed.to(self.device, dtype=self.dtype), weight_v2, faceid_v2)
else:
image_prompt_embeds, uncond_image_prompt_embeds = self.ipadapter.get_image_embeds(clip_embed.to(self.device, dtype=self.dtype), clip_embed_zeroed.to(self.device, dtype=self.dtype))
@@ -701,8 +700,40 @@ class IPAdapterApply:
set_model_patch_replace(work_model, patch_kwargs, ("middle", 0, index))
patch_kwargs["number"] += 1
# manual GC (TODO: check if helps in any way)
image_prompt_embeds = None
uncond_image_prompt_embeds = None
face_embed = None
neg_image = None
clip_embed = None
clip_embed_zeroed = None
return (work_model, )
class IPAdapterApplyFaceID(IPAdapterApply):
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"ipadapter": ("IPADAPTER", ),
"clip_vision": ("CLIP_VISION",),
"insightface": ("INSIGHTFACE",),
"image": ("IMAGE",),
"model": ("MODEL", ),
"weight": ("FLOAT", { "default": 1.0, "min": -1, "max": 3, "step": 0.05 }),
"noise": ("FLOAT", { "default": 0.0, "min": 0.0, "max": 1.0, "step": 0.01 }),
"weight_type": (["original", "linear", "channel penalty"], ),
"start_at": ("FLOAT", { "default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001 }),
"end_at": ("FLOAT", { "default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001 }),
"faceid_v2": ("BOOLEAN", { "default": False }),
"weight_v2": ("FLOAT", { "default": 1.0, "min": -1, "max": 3, "step": 0.05 }),
"unfold_batch": ("BOOLEAN", { "default": False }),
},
"optional": {
"attn_mask": ("MASK",),
}
}
def prepImage(image, interpolation="LANCZOS", crop_position="center", size=(224,224), sharpening=0.0, padding=0):
_, oh, ow, _ = image.shape
output = image.permute([0,3,1,2])
@@ -953,12 +984,12 @@ class IPAdapterBatchEmbeds:
CATEGORY = "ipadapter"
def batch(self, embed1, embed2):
output = torch.cat((embed1, embed2), dim=1)
return (output, )
return (torch.cat((embed1, embed2), dim=1), )
NODE_CLASS_MAPPINGS = {
"IPAdapterModelLoader": IPAdapterModelLoader,
"IPAdapterApply": IPAdapterApply,
"IPAdapterApplyFaceID": IPAdapterApplyFaceID,
"IPAdapterApplyEncoded": IPAdapterApplyEncoded,
"PrepImageForClipVision": PrepImageForClipVision,
"IPAdapterEncoder": IPAdapterEncoder,
@@ -972,6 +1003,7 @@ NODE_CLASS_MAPPINGS = {
NODE_DISPLAY_NAME_MAPPINGS = {
"IPAdapterModelLoader": "Load IPAdapter Model",
"IPAdapterApply": "Apply IPAdapter",
"IPAdapterApplyFaceID": "Apply Apply FaceID",
"IPAdapterApplyEncoded": "Apply IPAdapter from Encoded",
"PrepImageForClipVision": "Prepare Image For Clip Vision",
"IPAdapterEncoder": "Encode IPAdapter Image",
+5 -6
View File
@@ -5,7 +5,9 @@ IPAdapter implementation that follows the ComfyUI way of doing things. The code
## Important updates
**2023/12/28**: Added support for FaceID Plus models. **Important:** this update breaks the previous implementation of FaceID. Check the updated workflows in the exmaple directory!
**2023/12/30**: Added support for FaceID Plus v2 models. **Important:** this update again breaks the previous implementation. This time I had to make a new node just for FaceID. The base `IPAdapter Apply` node will work with all previous models; for all FaceID models you'll find an `IPAdapter Apply FaceID` node. **When using v2 remember to check the `v2` options otherwise it won't work as expected!** As always the examples directory is full of workflows for you to play with.
**2023/12/28**: Added support for FaceID Plus models. **Important:** this update breaks the previous implementation of FaceID. Check the updated workflows in the example directory! Remember to refresh the browser ComfyUI page to clear up the local cache.
**2023/12/22**: Added support for FaceID models. [Read the documentation](#faceid) for details.
@@ -21,10 +23,6 @@ IPAdapter implementation that follows the ComfyUI way of doing things. The code
**2023/11/08**: Added [attention masking](#attention-masking).
**2023/11/07**: Added three ways to apply the weight. [See below](#weight-types) for more info. **This might break things!** Please let me know if you are having issues. When loading an old workflow try to reload the page a couple of times or delete the `IPAdapter Apply` node and insert a new one.
**2023/11/02**: Added compatibility with the new models in safetensors format (available on [huggingface](https://huggingface.co/h94/IP-Adapter)).
*(previous updates removed for better readability)*
## What is it?
@@ -59,7 +57,7 @@ The pre-trained models are available on [huggingface](https://huggingface.co/h94
IPAdapter also needs the image encoders. You need the [CLIP-**ViT-H**-14-laion2B-s32B-b79K](https://huggingface.co/h94/IP-Adapter/resolve/main/models/image_encoder/model.safetensors) and [CLIP-**ViT-bigG**-14-laion2B-39B-b160k](https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/image_encoder/model.safetensors) image encoders, you may already have them. If you don't, download them but **be careful because the file name is the same!** Rename them to something easy to remember and place them in the `ComfyUI/models/clip_vision/` directory.
The following table shows the combination of Checkpoint and Image encoder to use for each IPAdapter Model. Any Tensor size error you may get it is likely caused by a wrong combination.
The following table shows the combination of Checkpoint and Image encoder to use for each IPAdapter Model. Any Tensor size mismatch you may get it is likely caused by a wrong combination.
| SD v. | IPadapter | Img encoder | Notes |
|---|---|---|---|
@@ -82,6 +80,7 @@ When the dependencies are satisfied you need:
|---|---|---|---|
| v1.5 | [FaceID](https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sd15.bin) | (not used¹) | [FaceID Lora](https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sd15_lora.safetensors) |
| v1.5 | [FaceID Plus](https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plus_sd15.bin) | ViT-H | [FaceID Plus Lora](https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plus_sd15_lora.safetensors) |
| v1.5 | [FaceID Plus v2](https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plusv2_sd15.bin) | ViT-H | [FaceID Plus v2 Lora](https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plusv2_sd15_lora.safetensors) |
¹ The base FaceID model doesn't make use of a CLIP vision encoder.
+289 -287
View File
@@ -1,13 +1,13 @@
{
"last_node_id": 32,
"last_link_id": 80,
"last_node_id": 36,
"last_link_id": 93,
"nodes": [
{
"id": 6,
"type": "VAEDecode",
"pos": [
1670,
620
1800,
610
],
"size": {
"0": 140,
@@ -46,8 +46,8 @@
"id": 7,
"type": "VAELoader",
"pos": [
1380,
920
1510,
910
],
"size": {
"0": 240,
@@ -233,6 +233,141 @@
1
]
},
{
"id": 14,
"type": "LoraLoaderModelOnly",
"pos": [
770,
410
],
"size": {
"0": 210,
"1": 82
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 15
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
85
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "LoraLoaderModelOnly"
},
"widgets_values": [
"ip-adapter-faceid_sd15_lora.safetensors",
0.6
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 22,
"type": "PreviewImage",
"pos": [
1990,
530
],
"size": {
"0": 527.009765625,
"1": 548.077880859375
},
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 72
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 32,
"type": "InsightFaceLoader",
"pos": [
691,
291
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "INSIGHTFACE",
"type": "INSIGHTFACE",
"links": [
84
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "InsightFaceLoader"
},
"widgets_values": [
"CPU"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 31,
"type": "CLIPVisionLoader",
"pos": [
691,
172
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
82
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 10,
"type": "LoadImage",
@@ -245,14 +380,14 @@
"1": 482.0174560546875
},
"flags": {},
"order": 3,
"order": 5,
"mode": 0,
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
77
83
],
"shape": 3,
"slot_index": 0
@@ -274,12 +409,119 @@
"color": "#223",
"bgcolor": "#335"
},
{
"id": 9,
"type": "IPAdapterModelLoader",
"pos": [
691,
58
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 6,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
81
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-faceid-plus_sd15.bin"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 33,
"type": "IPAdapterApplyFaceID",
"pos": [
1095,
166
],
"size": {
"0": 315,
"1": 326
},
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "ipadapter",
"type": "IPADAPTER",
"link": 81
},
{
"name": "clip_vision",
"type": "CLIP_VISION",
"link": 82
},
{
"name": "insightface",
"type": "INSIGHTFACE",
"link": 84
},
{
"name": "image",
"type": "IMAGE",
"link": 83
},
{
"name": "model",
"type": "MODEL",
"link": 85
},
{
"name": "attn_mask",
"type": "MASK",
"link": null
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
93
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterApplyFaceID"
},
"widgets_values": [
1.2,
0,
"original",
0,
1,
false,
1,
false
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 1,
"type": "KSampler",
"pos": [
1380,
620
1510,
610
],
"size": {
"0": 240,
@@ -292,7 +534,7 @@
{
"name": "model",
"type": "MODEL",
"link": 78
"link": 93
},
{
"name": "positive",
@@ -324,254 +566,14 @@
"Node name for S&R": "KSampler"
},
"widgets_values": [
2,
1,
"fixed",
25,
6,
7,
"dpmpp_2m",
"karras",
1
]
},
{
"id": 22,
"type": "PreviewImage",
"pos": [
1861,
542
],
"size": {
"0": 527.009765625,
"1": 548.077880859375
},
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 72
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 11,
"type": "IPAdapterApply",
"pos": [
1060,
240
],
"size": {
"0": 210,
"1": 278
},
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "ipadapter",
"type": "IPADAPTER",
"link": 10
},
{
"name": "clip_vision",
"type": "CLIP_VISION",
"link": 79,
"slot_index": 1
},
{
"name": "image",
"type": "IMAGE",
"link": 77
},
{
"name": "model",
"type": "MODEL",
"link": 16
},
{
"name": "attn_mask",
"type": "MASK",
"link": null
},
{
"name": "insightface",
"type": "INSIGHTFACE",
"link": 80,
"slot_index": 5
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
78
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterApply"
},
"widgets_values": [
0.9,
0,
"original",
0,
1,
false
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 32,
"type": "InsightFaceLoader",
"pos": [
650,
290
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "INSIGHTFACE",
"type": "INSIGHTFACE",
"links": [
80
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "InsightFaceLoader"
},
"widgets_values": [
"CPU"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 14,
"type": "LoraLoaderModelOnly",
"pos": [
770,
410
],
"size": {
"0": 210,
"1": 82
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 15
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
16
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "LoraLoaderModelOnly"
},
"widgets_values": [
"ip-adapter-faceid-plus_sd15_lora.safetensors",
0.6
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 31,
"type": "CLIPVisionLoader",
"pos": [
650,
190
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 5,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
79
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 9,
"type": "IPAdapterModelLoader",
"pos": [
650,
90
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 6,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
10
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-faceid-plus_sd15.bin"
],
"color": "#223",
"bgcolor": "#335"
}
],
"links": [
@@ -631,14 +633,6 @@
1,
"VAE"
],
[
10,
9,
0,
11,
0,
"IPADAPTER"
],
[
15,
2,
@@ -647,14 +641,6 @@
0,
"MODEL"
],
[
16,
14,
0,
11,
3,
"MODEL"
],
[
72,
6,
@@ -664,36 +650,52 @@
"IMAGE"
],
[
77,
10,
81,
9,
0,
11,
2,
"IMAGE"
33,
0,
"IPADAPTER"
],
[
78,
11,
0,
1,
0,
"MODEL"
],
[
79,
82,
31,
0,
11,
33,
1,
"CLIP_VISION"
],
[
80,
83,
10,
0,
33,
3,
"IMAGE"
],
[
84,
32,
0,
11,
5,
33,
2,
"INSIGHTFACE"
],
[
85,
14,
0,
33,
4,
"MODEL"
],
[
93,
33,
0,
1,
0,
"MODEL"
]
],
"groups": [],
+705
View File
@@ -0,0 +1,705 @@
{
"last_node_id": 36,
"last_link_id": 93,
"nodes": [
{
"id": 6,
"type": "VAEDecode",
"pos": [
1800,
610
],
"size": {
"0": 140,
"1": 50
},
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
72
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 7,
"type": "VAELoader",
"pos": [
1510,
910
],
"size": {
"0": 240,
"1": 60
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAELoader"
},
"widgets_values": [
"vae-ft-mse-840000-ema-pruned.safetensors"
]
},
{
"id": 2,
"type": "CheckpointLoaderSimple",
"pos": [
50,
700
],
"size": {
"0": 290,
"1": 100
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
15
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
5,
6
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"sd15/realisticVisionV51_v51VAE.safetensors"
]
},
{
"id": 4,
"type": "CLIPTextEncode",
"pos": [
710,
570
],
"size": {
"0": 400,
"1": 160
},
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"closeup photo of a woman wearing a white spring dress in a garden\n\nhigh quality, diffuse light, highly detailed, 4k"
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 5,
"type": "CLIPTextEncode",
"pos": [
710,
777
],
"size": {
"0": 400,
"1": 160
},
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 6
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
3
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"blurry, malformed, distorted, naked"
],
"color": "#322",
"bgcolor": "#533"
},
{
"id": 3,
"type": "EmptyLatentImage",
"pos": [
892,
994
],
"size": {
"0": 210,
"1": 110
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
4
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 14,
"type": "LoraLoaderModelOnly",
"pos": [
770,
410
],
"size": {
"0": 210,
"1": 82
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 15
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
85
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "LoraLoaderModelOnly"
},
"widgets_values": [
"ip-adapter-faceid_sd15_lora.safetensors",
0.6
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 22,
"type": "PreviewImage",
"pos": [
1990,
530
],
"size": {
"0": 527.009765625,
"1": 548.077880859375
},
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 72
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 32,
"type": "InsightFaceLoader",
"pos": [
691,
291
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "INSIGHTFACE",
"type": "INSIGHTFACE",
"links": [
84
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "InsightFaceLoader"
},
"widgets_values": [
"CPU"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 31,
"type": "CLIPVisionLoader",
"pos": [
691,
172
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
82
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 10,
"type": "LoadImage",
"pos": [
180,
-50
],
"size": {
"0": 390.733154296875,
"1": 482.0174560546875
},
"flags": {},
"order": 5,
"mode": 0,
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
83
],
"shape": 3,
"slot_index": 0
},
{
"name": "MASK",
"type": "MASK",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"cwf_portrait.jpg",
"image"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 9,
"type": "IPAdapterModelLoader",
"pos": [
691,
58
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 6,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
81
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-faceid-plusv2_sd15.bin"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 33,
"type": "IPAdapterApplyFaceID",
"pos": [
1095,
166
],
"size": {
"0": 315,
"1": 326
},
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "ipadapter",
"type": "IPADAPTER",
"link": 81
},
{
"name": "clip_vision",
"type": "CLIP_VISION",
"link": 82
},
{
"name": "insightface",
"type": "INSIGHTFACE",
"link": 84
},
{
"name": "image",
"type": "IMAGE",
"link": 83
},
{
"name": "model",
"type": "MODEL",
"link": 85
},
{
"name": "attn_mask",
"type": "MASK",
"link": null
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
93
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterApplyFaceID"
},
"widgets_values": [
0.9,
0,
"original",
0,
1,
true,
1,
false
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 1,
"type": "KSampler",
"pos": [
1510,
610
],
"size": {
"0": 240,
"1": 262
},
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 93
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 2
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 3
},
{
"name": "latent_image",
"type": "LATENT",
"link": 4
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
1,
"fixed",
25,
6.5,
"dpmpp_2m",
"karras",
1
]
}
],
"links": [
[
2,
4,
0,
1,
1,
"CONDITIONING"
],
[
3,
5,
0,
1,
2,
"CONDITIONING"
],
[
4,
3,
0,
1,
3,
"LATENT"
],
[
5,
2,
1,
4,
0,
"CLIP"
],
[
6,
2,
1,
5,
0,
"CLIP"
],
[
7,
1,
0,
6,
0,
"LATENT"
],
[
8,
7,
0,
6,
1,
"VAE"
],
[
15,
2,
0,
14,
0,
"MODEL"
],
[
72,
6,
0,
22,
0,
"IMAGE"
],
[
81,
9,
0,
33,
0,
"IPADAPTER"
],
[
82,
31,
0,
33,
1,
"CLIP_VISION"
],
[
83,
10,
0,
33,
3,
"IMAGE"
],
[
84,
32,
0,
33,
2,
"INSIGHTFACE"
],
[
85,
14,
0,
33,
4,
"MODEL"
],
[
93,
33,
0,
1,
0,
"MODEL"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}
+234 -232
View File
@@ -1,13 +1,13 @@
{
"last_node_id": 32,
"last_link_id": 80,
"last_node_id": 36,
"last_link_id": 93,
"nodes": [
{
"id": 6,
"type": "VAEDecode",
"pos": [
1670,
620
1800,
610
],
"size": {
"0": 140,
@@ -46,8 +46,8 @@
"id": 7,
"type": "VAELoader",
"pos": [
1380,
920
1510,
910
],
"size": {
"0": 240,
@@ -233,47 +233,6 @@
1
]
},
{
"id": 10,
"type": "LoadImage",
"pos": [
180,
-50
],
"size": {
"0": 390.733154296875,
"1": 482.0174560546875
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
77
],
"shape": 3,
"slot_index": 0
},
{
"name": "MASK",
"type": "MASK",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"cwf_portrait.jpg",
"image"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 14,
"type": "LoraLoaderModelOnly",
@@ -300,7 +259,7 @@
"name": "MODEL",
"type": "MODEL",
"links": [
16
85
],
"shape": 3,
"slot_index": 0
@@ -316,12 +275,180 @@
"color": "#223",
"bgcolor": "#335"
},
{
"id": 22,
"type": "PreviewImage",
"pos": [
1990,
530
],
"size": {
"0": 527.009765625,
"1": 548.077880859375
},
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 72
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 32,
"type": "InsightFaceLoader",
"pos": [
691,
291
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "INSIGHTFACE",
"type": "INSIGHTFACE",
"links": [
84
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "InsightFaceLoader"
},
"widgets_values": [
"CPU"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 9,
"type": "IPAdapterModelLoader",
"pos": [
691,
58
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
81
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-faceid_sd15.bin"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 31,
"type": "CLIPVisionLoader",
"pos": [
691,
172
],
"size": {
"0": 290,
"1": 60
},
"flags": {},
"order": 5,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
82
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 10,
"type": "LoadImage",
"pos": [
180,
-50
],
"size": {
"0": 390.733154296875,
"1": 482.0174560546875
},
"flags": {},
"order": 6,
"mode": 0,
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
83
],
"shape": 3,
"slot_index": 0
},
{
"name": "MASK",
"type": "MASK",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"cwf_portrait.jpg",
"image"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 1,
"type": "KSampler",
"pos": [
1380,
620
1510,
610
],
"size": {
"0": 240,
@@ -334,7 +461,7 @@
{
"name": "model",
"type": "MODEL",
"link": 78
"link": 93
},
{
"name": "positive",
@@ -366,9 +493,9 @@
"Node name for S&R": "KSampler"
},
"widgets_values": [
2,
1,
"fixed",
25,
30,
6,
"dpmpp_2m",
"karras",
@@ -376,40 +503,15 @@
]
},
{
"id": 22,
"type": "PreviewImage",
"id": 33,
"type": "IPAdapterApplyFaceID",
"pos": [
1861,
542
1095,
166
],
"size": {
"0": 527.009765625,
"1": 548.077880859375
},
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 72
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 11,
"type": "IPAdapterApply",
"pos": [
1060,
240
],
"size": {
"0": 210,
"1": 278
"0": 315,
"1": 326
},
"flags": {},
"order": 10,
@@ -418,34 +520,32 @@
{
"name": "ipadapter",
"type": "IPADAPTER",
"link": 10
"link": 81
},
{
"name": "clip_vision",
"type": "CLIP_VISION",
"link": 79,
"slot_index": 1
"link": 82
},
{
"name": "insightface",
"type": "INSIGHTFACE",
"link": 84
},
{
"name": "image",
"type": "IMAGE",
"link": 77
"link": 83
},
{
"name": "model",
"type": "MODEL",
"link": 16
"link": 85
},
{
"name": "attn_mask",
"type": "MASK",
"link": null
},
{
"name": "insightface",
"type": "INSIGHTFACE",
"link": 80,
"slot_index": 5
}
],
"outputs": [
@@ -453,125 +553,27 @@
"name": "MODEL",
"type": "MODEL",
"links": [
78
93
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterApply"
"Node name for S&R": "IPAdapterApplyFaceID"
},
"widgets_values": [
0.9,
1,
0,
"original",
0,
1,
false,
1,
false
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 9,
"type": "IPAdapterModelLoader",
"pos": [
650,
90
],
"size": [
290,
60
],
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
10
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-faceid_sd15.bin"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 31,
"type": "CLIPVisionLoader",
"pos": [
650,
190
],
"size": [
290,
60
],
"flags": {},
"order": 5,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
79
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 32,
"type": "InsightFaceLoader",
"pos": [
650,
290
],
"size": [
290,
60
],
"flags": {},
"order": 6,
"mode": 0,
"outputs": [
{
"name": "INSIGHTFACE",
"type": "INSIGHTFACE",
"links": [
80
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "InsightFaceLoader"
},
"widgets_values": [
"CPU"
],
"color": "#223",
"bgcolor": "#335"
}
],
"links": [
@@ -631,14 +633,6 @@
1,
"VAE"
],
[
10,
9,
0,
11,
0,
"IPADAPTER"
],
[
15,
2,
@@ -647,14 +641,6 @@
0,
"MODEL"
],
[
16,
14,
0,
11,
3,
"MODEL"
],
[
72,
6,
@@ -664,36 +650,52 @@
"IMAGE"
],
[
77,
10,
81,
9,
0,
11,
2,
"IMAGE"
33,
0,
"IPADAPTER"
],
[
78,
11,
0,
1,
0,
"MODEL"
],
[
79,
82,
31,
0,
11,
33,
1,
"CLIP_VISION"
],
[
80,
83,
10,
0,
33,
3,
"IMAGE"
],
[
84,
32,
0,
11,
5,
33,
2,
"INSIGHTFACE"
],
[
85,
14,
0,
33,
4,
"MODEL"
],
[
93,
33,
0,
1,
0,
"MODEL"
]
],
"groups": [],
File diff suppressed because it is too large Load Diff