Paper99 commited on
Commit
a79c181
β€’
1 Parent(s): 68221c5

Update PhotoMaker v2 demo

Browse files
Files changed (1) hide show
  1. pipeline_t2i_adapter.py +2 -1
pipeline_t2i_adapter.py CHANGED
@@ -1,5 +1,5 @@
1
  #####
2
- # Modified from https://github.com/huggingface/diffusers/blob/v0.29.1/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py
3
  # PhotoMaker v2 @ TencentARC and MCG-NKU
4
  # Author: Zhen Li
5
  #####
@@ -249,6 +249,7 @@ class PhotoMakerStableDiffusionXLAdapterPipeline(StableDiffusionXLAdapterPipelin
249
  if keys != ["id_encoder", "lora_weights"]:
250
  raise ValueError("Required keys are (`id_encoder` and `lora_weights`) missing from the state dict.")
251
 
 
252
  self.trigger_word = trigger_word
253
  # load finetuned CLIP image encoder and fuse module here if it has not been registered to the pipeline yet
254
  print(f"Loading PhotoMaker {pm_version} components [1] id_encoder from [{pretrained_model_name_or_path_or_dict}]...")
 
1
  #####
2
+ # Modified from https://github.com/huggingface/diffusers/blob/v0.29.1/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py
3
  # PhotoMaker v2 @ TencentARC and MCG-NKU
4
  # Author: Zhen Li
5
  #####
 
249
  if keys != ["id_encoder", "lora_weights"]:
250
  raise ValueError("Required keys are (`id_encoder` and `lora_weights`) missing from the state dict.")
251
 
252
+ self.num_tokens = 2
253
  self.trigger_word = trigger_word
254
  # load finetuned CLIP image encoder and fuse module here if it has not been registered to the pipeline yet
255
  print(f"Loading PhotoMaker {pm_version} components [1] id_encoder from [{pretrained_model_name_or_path_or_dict}]...")