Spaces:
Running
on
Zero
Running
on
Zero
Update pipline_StableDiffusion_ConsistentID.py
Browse files
pipline_StableDiffusion_ConsistentID.py
CHANGED
@@ -43,7 +43,7 @@ class ConsistentIDStableDiffusionPipeline(StableDiffusionPipeline):
|
|
43 |
subfolder: str = '',
|
44 |
trigger_word_ID: str = '<|image|>',
|
45 |
trigger_word_facial: str = '<|facial|>',
|
46 |
-
image_encoder_path: str = '
|
47 |
torch_dtype = torch.float16,
|
48 |
num_tokens = 4,
|
49 |
lora_rank= 128,
|
@@ -68,7 +68,7 @@ class ConsistentIDStableDiffusionPipeline(StableDiffusionPipeline):
|
|
68 |
### BiSeNet
|
69 |
self.bise_net = BiSeNet(n_classes = 19)
|
70 |
self.bise_net.cuda()
|
71 |
-
self.bise_net_cp='./models/BiSeNet_pretrained_for_ConsistentID.pth' #TODO
|
72 |
self.bise_net.load_state_dict(torch.load(self.bise_net_cp))
|
73 |
self.bise_net.eval()
|
74 |
# Colors for all 20 parts
|
@@ -83,7 +83,7 @@ class ConsistentIDStableDiffusionPipeline(StableDiffusionPipeline):
|
|
83 |
[0, 255, 255], [85, 255, 255], [170, 255, 255]]
|
84 |
|
85 |
### LLVA Optional
|
86 |
-
self.llva_model_path = "
|
87 |
self.llva_prompt = "Describe this person's facial features for me, including face, ears, eyes, nose, and mouth."
|
88 |
self.llva_tokenizer, self.llva_model, self.llva_image_processor, self.llva_context_len = None,None,None,None #load_pretrained_model(self.llva_model_path)
|
89 |
|
|
|
43 |
subfolder: str = '',
|
44 |
trigger_word_ID: str = '<|image|>',
|
45 |
trigger_word_facial: str = '<|facial|>',
|
46 |
+
image_encoder_path: str = 'CLIP-ViT-H-14-laion2B-s32B-b79K', # TODO
|
47 |
torch_dtype = torch.float16,
|
48 |
num_tokens = 4,
|
49 |
lora_rank= 128,
|
|
|
68 |
### BiSeNet
|
69 |
self.bise_net = BiSeNet(n_classes = 19)
|
70 |
self.bise_net.cuda()
|
71 |
+
self.bise_net_cp='./models/BiSeNet_pretrained_for_ConsistentID.pth' #TODO
|
72 |
self.bise_net.load_state_dict(torch.load(self.bise_net_cp))
|
73 |
self.bise_net.eval()
|
74 |
# Colors for all 20 parts
|
|
|
83 |
[0, 255, 255], [85, 255, 255], [170, 255, 255]]
|
84 |
|
85 |
### LLVA Optional
|
86 |
+
self.llva_model_path = "llava-v1.5-7b" #TODO
|
87 |
self.llva_prompt = "Describe this person's facial features for me, including face, ears, eyes, nose, and mouth."
|
88 |
self.llva_tokenizer, self.llva_model, self.llva_image_processor, self.llva_context_len = None,None,None,None #load_pretrained_model(self.llva_model_path)
|
89 |
|