Merge branch 'comfyanonymous:master' into bugfix/extra_data

This commit is contained in:
Dr.Lt.Data 2023-07-10 00:11:22 +09:00 committed by GitHub
commit b61c62d11f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -238,6 +238,8 @@ def unload_model():
current_loaded_model.model_patches_to(current_loaded_model.offload_device) current_loaded_model.model_patches_to(current_loaded_model.offload_device)
current_loaded_model.unpatch_model() current_loaded_model.unpatch_model()
current_loaded_model = None current_loaded_model = None
if vram_state != VRAMState.HIGH_VRAM:
soft_empty_cache()
if vram_state != VRAMState.HIGH_VRAM: if vram_state != VRAMState.HIGH_VRAM:
if len(current_gpu_controlnets) > 0: if len(current_gpu_controlnets) > 0:

View File

@ -35,6 +35,8 @@ class SDXLClipG(sd1_clip.SD1ClipModel):
def load_sd(self, sd): def load_sd(self, sd):
if "text_projection" in sd: if "text_projection" in sd:
self.text_projection[:] = sd.pop("text_projection") self.text_projection[:] = sd.pop("text_projection")
if "text_projection.weight" in sd:
self.text_projection[:] = sd.pop("text_projection.weight").transpose(0, 1)
return super().load_sd(sd) return super().load_sd(sd)
class SDXLClipGTokenizer(sd1_clip.SD1Tokenizer): class SDXLClipGTokenizer(sd1_clip.SD1Tokenizer):