ai-toolkit/extensions_built_in
科林 KELIN 489b194231
Fix CPU/CUDA device mismatch in Klein edit control image encoding (#742)
When training Klein models with a `control_path` (edit/kontext-style
paired datasets), `encode_image_refs()` returns tensors that reside on
the VAE's device (CPU, since the VAE weights are loaded via
`load_file(..., device="cpu")` and are never explicitly moved to the
training device).  Concatenating those CPU tensors with the training
latents (`packed_latents`) that live on CUDA raises:

    RuntimeError: Expected all tensors to be on the same device

Fix: move `img_cond_seq` and `img_cond_seq_ids` to the same device
(and dtype) as `img_input` / `img_input_ids` before concatenation.

Co-authored-by: HuangYuChuh <HuangYuChuh@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 11:45:38 -06:00
..
advanced_generator A lot of pixart sigma training tweaks 2024-07-28 11:23:18 -06:00
concept_replacer bug fixes 2023-09-09 15:04:44 -06:00
concept_slider Regularize the slider targets. 2025-09-17 09:36:33 -06:00
dataset_tools Added some split prompting started code, adamw8bit, replacements improving, learnable snr gos. A lot of good stuff. 2023-11-01 06:52:21 -06:00
diffusion_models Fix CPU/CUDA device mismatch in Klein edit control image encoding (#742) 2026-03-25 11:45:38 -06:00
flex2 Added mask diffirential mask dialation for flex2. Handle video for the i2v adapter 2025-04-10 11:50:01 -06:00
image_reference_slider_trainer Bugfixes for slider reference 2023-09-10 18:36:23 -06:00
sd_trainer Remove the 0.1 floor for amplification 2026-03-22 09:01:58 -06:00
ultimate_slider_trainer Added a converter back to ldm from diffusers for sdxl. Can finally get to training it properly 2023-08-21 16:22:01 -06:00