fix CLIP doing the unneeded normalization

revert SD2.1 back to use the original repo
add SDXL's force_zero_embeddings to negative prompt
This commit is contained in:
AUTOMATIC1111
2023-07-13 11:35:52 +03:00
parent 21aec6f567
commit 594c8e7b26
6 changed files with 29 additions and 8 deletions

View File

@@ -22,7 +22,8 @@ def get_learned_conditioning(self: sgm.models.diffusion.DiffusionEngine, batch:
"target_size_as_tuple": torch.tensor([height, width]).repeat(len(batch), 1).to(devices.device, devices.dtype),
}
c = self.conditioner(sdxl_conds)
force_zero_negative_prompt = getattr(batch, 'is_negative_prompt', False) and all(x == '' for x in batch)
c = self.conditioner(sdxl_conds, force_zero_embeddings=['txt'] if force_zero_negative_prompt else [])
return c