New Model: Ideogram 4#1522
Conversation
…model composition in ModelType - Gradient checkpointing and layer offloading are now configured per component (text encoder, transformer, VAE) rather than globally - ModelType centralizes model composition and training method associations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…16 (Nerogar#147…" This reverts commit 574ec55.
Several model savers (Ernie, Flux2, Z-Image, ...) duplicate the same deepcopy + tokenizer __deepcopy__ workaround to produce a dtype-converted copy of a diffusers pipeline for saving. Extract it into a shared helper so new savers can reuse it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a tokenizer_attrs parameter (default ("tokenizer",)) so savers with
extra/different tokenizer attributes (Flux's tokenizer_2, SD3's
tokenizer_3, HiDream's tokenizer_3/tokenizer_4) can use the same helper.
Replaces the duplicated deepcopy + tokenizer __deepcopy__ workaround in
Chroma, Ernie, Flux, Flux2, HiDream, HunyuanVideo, PixArtAlpha, Qwen,
Sana, StableDiffusion3 and Z-Image with calls to the shared helper.
No behavior change.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move the per-callsite checkpointing_or_offloading_enabled() guard into enable_checkpointing() itself, so every Base*Setup can call enable_checkpointing_for_* unconditionally. Also extend the central gate to allow a compile-only path (no checkpointing/offloading, but still per-layer torch.compile wrapping) when config.compile is set. Three direct diffusers enable_gradient_checkpointing() calls (SD/SDXL unet, Wuerstchen v2 prior) keep their explicit guard since they bypass this central mechanism.
Ports the Ideogram 4 image generation model into OneTrainer, including model loading/saving, data loading, sampling, training setups for LoRA and Fine Tune, and corresponding UI and preset additions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
I think that enabling cfg sampling for the cond with uncond model not loaded is a reasonable choice and does not need to be gated behind cfg 1.0. Not sure if posting it here or in the discord is better, just something I encountered and had an opinion on. |
the idea isn't to arbitrarily gate it - an unconditional is needed for cfg > 1.0. |
Yeah, sorry I should have been more clear about this. Using the cond as the uncond with an empty prompt is indeed an approach that works "reasonably" well, i.e. good enough for fast sample previews, and what I would like to propose. |
ok, will add that. but also consider to just load the unconditional if you have the RAM. |
Good point, I am not that short on ram. Personally I just didn't know if the lora would be applied on the uncond or not, and was trying to play it safe with the sampling. |
the LoRA is currently not applied to the unconditional for sampling. maybe it should be, on Discord there was a good example that this is helpful (almost necessary according to that sample) |
# Conflicts: # modules/modelSetup/BaseErnieSetup.py # modules/modelSetup/BaseWuerstchenSetup.py # modules/util/checkpointing_util.py # training_presets/#flux2 LoRA 8GB.json
# Conflicts: # modules/ui/TimestepDistributionWindow.py # modules/ui/TrainingTab.py
Mirrors upstream commit 75a44d2, which converted the rest of the codebase from the trailing factory.register() call to the @factory.register decorator form.
# Conflicts: # modules/modelLoader/mixin/HFModelLoaderMixin.py # requirements-global.txt
…xt caching, autocast arg count) Audit per WORKFLOW_PREVIEW.md checklist after merging #1522: IdeogramModel still used the old to() API instead of release(), three files still referenced config.latent_caching instead of image_caching/text_caching, and BaseIdeogramSetup still called create_autocast_context/disable_fp16_autocast_context with the old weight-list argument. Also adds the Ideogram LoRA preset to run_lora_presets.sh, which was missing.
Test in preview branch: https://github.com/Nerogar/OneTrainer/tree/preview
Summary
Summary:
Note:
Test plan
pre-commit run --all-filespassesAI assistance