* feat: add native Wan 2.2 14B video model
* fix(video): clear generated cache on shutdown
* fix(wan22): require explicit A14B expert paths
* fix(wan22): address FP8 and VAE review findings
* refactor(video): integrate Wan loaders and lifecycle with TheNoise
* vibe-coded z-image-turbo support
written by DeepSeek-V4-Flash-0731 , lemonade , and opencode.
adapt z-image-turbo to sampler/VAE refactors
match Z-Image and Flux VAE to ComfyUI checkpoint layouts
The Comfy-Org single-file exports use ComfyUI/Lumina key names rather than the
official diffusers layouts:
- Z-Image DiT: fused qkv attention with q_norm/k_norm/out, plain x_embedder and
final_layer (no all_x_embedder/all_final_layer ModuleDict).
- Flux VAE: ComfyUI naming (mid.block_1/attn_1/block_2, up.N.block.M,
upsample.conv nearest upsamplers, nin_shortcut, norm_out) and reverse-indexed
up blocks (up.3 -> up.2 -> up.1 -> up.0).
Also strip the decoder. prefix when loading the Flux VAE so the strict load
succeeds, and fix the README --dit/--vae example paths (split_files/).
fix Z-Image dtype and force the euler sampler
- TimestepEmbedder: cast the fp32 sinusoidal embedding to the projection weight
dtype (bf16) before the MLP, fixing a Float/BFloat16 matmul error.
- ZImageModel.generate: coerce er_sde -> euler with a warning. The web UI defaults
to er_sde, but Z-Image's flow schedule (model timestep t = 1 - sigma) is only
compatible with the Euler solver; er_sde reads step.t as sigma and would produce
wrong output.
fix Z-Image gray output: velocity sign, shifted schedule, text-encoder dtype
- denoise_step: the FlowMatch scheduler integrates x + dt * noise_pred with
noise_pred = -model_out, so the velocity fed to the shared euler loop (x -= delta*v)
must be the NEGATED DiT output. The missing negation sent the trajectory the wrong
way, collapsing the image to gray.
- sampling: Z-Image-Turbo's sigmas are the static-shifted grid (shift = 3.0,
use_dynamic_shifting = False), not the uniform linspace I had. Apply
sigma' = 3*s/(1 + 2*s) so deltas and model timesteps (t = 1 - sigma') match the
official scheduler.
- text encoder: use dtype= instead of the deprecated torch_dtype= to silence the
transformers warning.
fix Z-Image and Flux VAE attention SDPA layouts
The Z-Image DiT attention fed [batch, seq, heads, head_dim] straight into
scaled_dot_product_attention instead of transposing to [batch, heads,
seq, head_dim], so tokens never mixed and the latent drifted to ~2x std.
The Flux VAE decoder attention had two bugs: it reshaped q/k/v with the
wrong transpose so it attended over a single token instead of the H*W
spatial positions, and it dropped the residual connection, collapsing
the decoder to gray output. Both now follow the reference layout and
restore x + proj_out(attention).
* refine Z-Image support
- single-file Qwen3 text encoder (vendored config, init_empty_weights, tied lm_head)
- torch.compile(fullgraph=True) on transformer blocks (ZIMAGE_NO_COMPILE opt-out)
- reuse the shared attention util in the Z-Image Attention
- feed sigma as Step.t so both euler and er_sde work; derive t=1-sigma in denoise_step
- fix CFG velocity composition (unconditional baseline was -pos instead of -neg)
- default guidance scale to 1 (ComfyUI 'off' convention)
- fetch text encoder / flux upscaler provisioning in the downloader
Co-authored-by: DeepSeek-V4-Flash-0731 <[email protected]>
* use the Flux latent upscaler for Z-Image upscaling
- enable the flux format in _UPSCALER_FORMATS and add make_flux weights (bf16)
- ZImageModel._upscale_format() -> flux (Flux VAE affine shift/scale latent)
- downloader fetches the SesquiLSR Flux upscaler and converts fp32 -> bf16
- tests for the flux format and upscaler loading
* address feedback (part 1)
* vendor the Z-Image Qwen3 tokenizer config
---------
Co-authored-by: DeepSeek-V4-Flash-0731 <[email protected]>
- download_krea2.py: fetch bf16 files from Comfy-Org/Krea-2 (no auth);
repo structure/file names updated
- Rename diffuse/dit/anima/hunyuan.py -> sampling.py; prune all dead code
(rotary/guidance helpers unused by inference) to just get_timesteps_sigmas
and step; update adapter import
- Remove Japanese comments in strategy_base.py (English equivalents)
- Fix stale target_keys/exclude_keys args in load_safetensors_with_lora
- Remove docs/DEVELOPMENT_PLAN.md (implementation complete)
- Drop stale hunyuan references; update README Krea2 example paths
- Delete vendor/ (musubi_tuner + sd_scripts) entirely
- diffuse/__init__.py no longer mutates sys.path
- pyproject.toml: declare all diffuse subpackages + tokenizer config data
- Remove dead debug main block in the shared VAE