Text Encoder cache (WIP)

This commit is contained in:
Kohya S
2024-11-27 12:57:04 +09:00
parent bdac55ebbc
commit 3677094256
15 changed files with 628 additions and 471 deletions

View File

@@ -321,7 +321,11 @@ def train(args):
if args.cache_text_encoder_outputs:
# Text Encodes are eval and no grad
text_encoder_output_caching_strategy = strategy_sdxl.SdxlTextEncoderOutputsCachingStrategy(
args.cache_text_encoder_outputs_to_disk, None, False, is_weighted=args.weighted_captions
args.cache_text_encoder_outputs_to_disk,
None,
args.skip_cache_check,
args.max_token_length,
is_weighted=args.weighted_captions,
)
strategy_base.TextEncoderOutputsCachingStrategy.set_strategy(text_encoder_output_caching_strategy)