fix:svdLoader error when the positive is empty

This commit is contained in:
yolain
2024-02-29 16:15:42 +08:00
parent b900d17c1d
commit f28cbf78e4
4 changed files with 11 additions and 3 deletions
+4
View File
@@ -39,6 +39,10 @@ Usage:<br>
## Changelog
**2024-02-29**
- Fixed `easy svdLoader` error when the positive or negative is empty
**2024-02-28**
- Fixed the issue that 'easy preSampling' and other similar node, latent could not be generated based on the batch index after passing in
+4
View File
@@ -43,6 +43,10 @@ stage_c 与 stage_b 可以使用[checkpoints](https://huggingface.co/stabilityai
## 更新日志
**2024-02-29**
- 修复 `easy svdLoader` 报错
**2024-02-28**
- 修复`easy preSampling`等 latent传入后无法根据批次索引生成的问题
+2 -2
View File
@@ -1254,13 +1254,13 @@ class svdLoader:
negative = [[torch.zeros_like(pooled),
{"motion_bucket_id": motion_bucket_id, "fps": fps, "augmentation_level": augmentation_level,
"concat_latent_image": torch.zeros_like(t)}]]
if optional_positive is not None:
if optional_positive is not None and optional_positive != '':
if clip_name == 'None':
raise Exception("You need choose a open_clip model when positive is not empty")
clip = easyCache.load_clip(clip_name)
positive_embeddings_final, = CLIPTextEncode().encode(clip, optional_positive)
positive, = ConditioningConcat().concat(positive, positive_embeddings_final)
if optional_negative is not None:
if optional_negative is not None and optional_negative != '':
if clip_name == 'None':
raise Exception("You need choose a open_clip model when negative is not empty")
negative_embeddings_final, = CLIPTextEncode().encode(clip, optional_negative)
+1 -1
View File
@@ -174,7 +174,7 @@ class easyLoader:
cache_name = ckpt_name + "_" + config_name
if cache_name in self.loaded_objects["ckpt"]:
clip_vision = self.loaded_objects["clip_vision"][cache_name][0] if load_vision else None
clip = self.loaded_objects["clip"][cache_name][0]
clip = self.loaded_objects["clip"][cache_name][0] if not load_vision else None
return self.loaded_objects["ckpt"][cache_name][0], clip, self.loaded_objects["bvae"][cache_name][0], clip_vision
ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)