Commit Graph
17 Commits
Author SHA1 Message Date
Rayane 99a4a5887b Fix Qwen attention mask crash with diffusers >=0.37 (#748)
* Fix Qwen Image mask handling

* Fix Qwen attention mask crash with diffusers >=0.37

diffusers v0.37 (PR #12987) optimizes all-ones attention masks to None
in encode_prompt() when there is no padding. This breaks ai-toolkit's
Qwen extensions which call .to() on the mask unconditionally.

Fix: reconstruct the all-ones mask at the boundary (get_prompt_embeds)
right after encode_prompt() returns. This keeps the rest of the code
unchanged and works with both old and new diffusers versions.

Also removes redundant duplicate mask assignments in qwen_image_edit
and qwen_image_edit_plus.

Fixes #740
2026-03-23 14:43:08 -06:00
Jaret Burkett 295094b4b5 Fixed new breaking change in diffusers with with qwen image 2026-03-23 14:10:55 -06:00
Jaret Burkett ff14cd6343 Fix check for making sure vae is on the right device. 2025-10-21 14:49:20 -06:00
Jaret Burkett 1bc6dee127 Change auto_memory to be layer_offloading and allow you to set the amount to unload 2025-10-10 13:12:32 -06:00
Jaret Burkett 4e5707854f Initial support for RamTorch. Still a WIP 2025-10-05 13:03:26 -06:00
Jaret Burkett 20dfe1b4d5 Small double tap of detach on qwen just for good measure 2025-09-18 08:22:04 -06:00
Jaret Burkett bf2700f7be Initial support for finetuning qwen image. Will only work with caching for now, need to add controls everywhere. 2025-08-21 16:41:17 -06:00
Jaret Burkett 83deaec417 Minor bug fixes 2025-08-21 08:05:34 -06:00
Jaret Burkett 259d68d440 Added a flushg during sampling to prevent spikes on low vram qwen 2025-08-12 12:57:18 -06:00
Jaret Burkett 77b10d884d Add support for training with an accuracy recovery adapter with qwen image 2025-08-12 08:21:36 -06:00
Jaret Burkett 4ad18f3d00 Clip max token embeddings to the max rope length for qwen image to solve for an error for super long captions > 1024 2025-08-10 08:44:41 -06:00
Jaret Burkett f0105c33a7 Fixed issue that sometimes happens in qwen image where text seq length is wrong 2025-08-09 16:33:05 -06:00
Jaret Burkett bb6db3d635 Added support for caching text embeddings. This is just initial support and will probably fail for some models. Still needs to be ompimized 2025-08-07 10:27:55 -06:00
Jaret Burkett 4c4a10d439 Remove vision model from qwen text encoder as it is not needed for image generation currently 2025-08-06 11:40:02 -06:00
Jaret Burkett 14ccf2f3ce Refactor qwen5b model code to be qwen 5b specific 2025-08-06 10:54:56 -06:00
Jaret Burkett 93202c7a2b Training working for Qwen Image 2025-08-04 21:14:30 +00:00
Jaret Burkett 9da8b5408e Initial but untested support for qwen_image 2025-08-04 13:29:37 -06:00