support weighted captions for SD/SDXL

This commit is contained in:
Kohya S
2024-10-11 08:48:55 +09:00
parent 886f75345c
commit f2bc820133
8 changed files with 105 additions and 45 deletions

View File

@@ -79,7 +79,9 @@ class SdxlNetworkTrainer(train_network.NetworkTrainer):
def get_text_encoder_outputs_caching_strategy(self, args):
if args.cache_text_encoder_outputs:
return strategy_sdxl.SdxlTextEncoderOutputsCachingStrategy(args.cache_text_encoder_outputs_to_disk, None, False)
return strategy_sdxl.SdxlTextEncoderOutputsCachingStrategy(
args.cache_text_encoder_outputs_to_disk, None, False, is_weighted=args.weighted_captions
)
else:
return None