Skip to content

split "Latent Caching" into "Image Caching" and "Text Caching"#1462

Open
dxqb wants to merge 3 commits into
Nerogar:masterfrom
dxqb:cache-selection
Open

split "Latent Caching" into "Image Caching" and "Text Caching"#1462
dxqb wants to merge 3 commits into
Nerogar:masterfrom
dxqb:cache-selection

Conversation

@dxqb

@dxqb dxqb commented May 17, 2026

Copy link
Copy Markdown
Collaborator

with text caches becoming very large on recent models, you might want to disable text caching - but still do image caching
this PR splits this setting into two:
grafik

Rename `config.latent_caching` to `config.image_caching` and add a new
orthogonal `config.text_caching` field. Adds config migration 10 -> 11
mapping the old field to both new fields, preserving existing behavior.

This enables the previously-impossible (no image cache, yes text cache)
configuration. Updates modelSetup placement decisions (VAE/effnet ->
image_caching, text encoder -> text_caching), dataloader mixin gating,
trainer cache-clear/start-next-epoch logic, UI switches, and tracked
preset JSONs.
@dxqb dxqb added the preview merged in the preview branch label May 29, 2026
dxqb added a commit that referenced this pull request Jun 3, 2026
- BaseAnimaSetup: per-component checkpointing_or_offloading_enabled(),
  remove weight_list from create_autocast_context / disable_fp16_autocast_context
- AnimaFineTune/LoRASetup: latent_caching → image_caching / text_caching
- ModelType: add ANIMA to _MODEL_PARTS and supported_training_methods

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dxqb added a commit to TheForgotten69/OneTrainer that referenced this pull request Jun 3, 2026
dxqb added a commit that referenced this pull request Jun 4, 2026
@dxqb dxqb mentioned this pull request Jun 13, 2026
@dxqb

This comment was marked as resolved.

dxqb added a commit that referenced this pull request Jun 14, 2026
# Conflicts:
#	modules/ui/TrainUI.py
#	modules/util/config/TrainConfig.py
dxqb added a commit that referenced this pull request Jun 14, 2026
Anima, Lens, and Ideogram setup files used the pre-#1476/#1462 4-arg
create_autocast_context/disable_fp16_autocast_context (with a weight-dtype
list), the old config.gradient_checkpointing.enabled() global check, and the
renamed config.latent_caching field. Update them to the current 3-arg
autocast helpers, per-part checkpointing via enable_checkpointing_for_*, and
config.image_caching/config.text_caching.
dxqb added a commit that referenced this pull request Jun 19, 2026
dxqb added 2 commits July 11, 2026 08:54
Resolve conflicts: renumber the image/text caching split as config
migration 11, since master had already taken slot 10 for an
unrelated offload fan-out migration. Drop modules/ui/TrainUI.py,
removed on master in favor of the Base/Ctk/PySide6 view split.
Ernie, Ideogram, Anima, and Krea2 were added to master after this
branch was created, so they still used the old latent_caching field.
Ernie and Ideogram: gate prune_masked_tokens/pad_masked_tokens on
text_caching (Ideogram also gets a real text_caching value instead of
a hardcoded True). Krea2: same, following ChromaBaseDataLoader's
train_text_encoder_or_embedding()-guarded pattern. Anima/Ideogram/
Krea2 setups: split VAE placement (image_caching) from text encoder
placement (text_caching). Also updates the ctk data tab, whose old
"Latent Caching" switch never got split.
@dxqb dxqb force-pushed the cache-selection branch from 98a8184 to e221eae Compare July 11, 2026 06:55
dxqb added a commit to dxqb/OneTrainer that referenced this pull request Jul 11, 2026
…d "Text Caching") into preview

# Conflicts:
#	modules/ui/BaseTrainUIView.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview merged in the preview branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant