Commit Graph

13218 Commits

Author SHA1 Message Date
CalamitousFelicitousness 41ffa78438 fix(ltx): align stage 2 audio to canonical pr #13217
drop the project-specific stage 1 direct audio decode (a6870f7d2). smoke
testing showed broadband tinniness on distilled is BWE-bound, not stage 2
corruption, so the deviation didn't fix the underlying issue.

revert to canonical:
- _latent_pass returns video latents only; result.audio is unused.
- stage 2 receives audio_latents=None (default), prepare_audio_latents
  generates fresh gaussian noise, audio scheduler runs the 3 stage-2
  sigmas under identity guidance, video<->audio cross-attention
  conditions the audio branch.
- capture stage 2 result.audio[0].float().cpu() for save.

upstream evidence: pipeline_ltx2.py:937-940 documents audio_latents as
pre-generated noisy latents (initial gaussian, not stage 1 output); no
caller in diffusers threads stage outputs into the kwarg.

non-latent path is unchanged and continues to work via p.audio_capture.
2026-05-02 19:56:30 +01:00
CalamitousFelicitousness 207e7d8b3b fix(processing): preserve pipeline audio across process_decode
process_decode strips video pipeline output to a flat list of frames at the
PIL early-return (processing_diffusers.py:461-465), so any output.audio is
lost before processing.process_images returns. video pipelines that produce
synchronized audio (LTX-2 audio-capable models) were getting silent mp4s on
the non-latent path.

stash output.audio on p.audio_capture before process_decode runs and let
processing read it back as a fallback when samples is a flat list.

ltx_process non-latent branch strips the (B, 2, N) batch dim with [0] so
write_audio's .T+contiguous() path produces interleaved bytes for AAC s16.
2026-05-02 19:43:43 +01:00
CalamitousFelicitousness a6870f7d27 fix(ltx): decode stage 1 audio directly, discard stage 2 audio output
stop threading stage 1 audio_latents into stage 2 refine. Lightricks/LTX-2#126
reports the two-stage pipeline degrades audio quality, confirmed locally as
clean speech with tinny ambient/foley/music on the threaded path.

root cause: stage 2 prepare_audio_latents calls _create_noised_state at
noise_scale=0.909 (pipeline_ltx2.py:704-714, 598-603), keeping ~9% of stage 1
signal. 3 refine steps recover speech via video<->audio cross-attention but
not broadband content.

new path: _latent_pass decodes audio_latents to waveform via audio_vae +
vocoder mirroring pipeline_ltx2.py:1471-1473 exactly (input cast to
audio_vae.dtype, no module dtype mutation). stage 2 result.audio is
discarded; cross-attention still runs each block for video conditioning.
2026-05-02 19:42:59 +01:00
CalamitousFelicitousness 506f5e1c29 fix(ltx): audio toggle ux and audio mux stream registration
relabel toggle to 'LTX save audio' (default true) since audio always
generates on 2.x audio-capable models; the toggle gates mux only. hint
added to locale_en.json.

split add_audio_stream from write_audio. avformat_write_header runs on
first container.mux() and freezes the stream set, so audio added after
video packets has time_base=0/0 and raises 'Cannot rebase to zero time.'
atomic_save_video registers the audio stream before the encode loop.
2026-05-02 19:38:08 +01:00
Vladimir Mandic c855a5146a cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-01 16:34:42 +02:00
CalamitousFelicitousness 450bf977e8 fix(lora): use native_active flag instead of applied_layers for restore trigger
applied_layers is cleared and re-populated on every network_activate call.
With lora_apply_te=True the second activate (TE-only pass) finds all
modules already at the target state and skips them all, leaving
applied_layers empty and breaking the restore trigger on the next gen.

native_active is set from loaded_networks at the end of activate, so it
survives idempotent re-runs and only flips false after the restore call
clears loaded_networks.
2026-05-01 01:38:56 +01:00
Vladimir Mandic 417312ce77 masking error handler
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-30 11:03:20 +02:00
Vladimir Mandic 0be4a2590f update modernui
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-30 10:06:55 +02:00
Vladimir Mandic 2a14d73fab add skip processing option
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-30 10:06:55 +02:00
Vladimir Mandic 772adf9396 Merge pull request #4816 from vladmandic/fix/save-intermediate-decoded-images
fix(save): handle already-decoded images in save_intermediate
2026-04-30 09:40:03 +02:00
Vladimir Mandic 83141d46a4 Merge pull request #4815 from vladmandic/feat/anima-img2img-inpaint
feat(anima): add image-to-image and inpainting support
2026-04-30 09:38:29 +02:00
Vladimir Mandic 98633b332d Merge pull request #4805 from awsr/fix-ext-install
Fix extension requirements install
2026-04-30 09:36:09 +02:00
Vladimir Mandic 66a270dc16 cleanup
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-30 09:32:10 +02:00
Vladimir Mandic eaf06fbc74 all direct input images
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-30 09:30:11 +02:00
CalamitousFelicitousness a5bf29edbe feat(anima): add image-to-image and inpainting support 2026-04-30 03:50:02 +01:00
CalamitousFelicitousness ae0cb1600c fix(save): handle already-decoded images in save_intermediate 2026-04-30 03:42:11 +01:00
Vladimir Mandic 44a13f9b63 nano banana prototype multi-image
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-29 20:38:23 +02:00
Vladimir Mandic 304918baec monkey-patch multi-image
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-29 19:53:14 +02:00
Vladimir Mandic ebc875d224 reorg control type
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-29 11:20:22 +02:00
Vladimir Mandic d9d1d92791 remove control init video/batch/folder
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-29 08:36:10 +02:00
Vladimir Mandic 60143027a0 remove media input buttons
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-29 08:18:02 +02:00
Vladimir Mandic 68f1c73e1f remove process preview
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-29 07:59:43 +02:00
Vladimir Mandic 079776bda6 Merge branch 'master' into dev 2026-04-29 07:13:35 +02:00
Vladimir Mandic 91fc249e59 update readme
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-29 07:12:34 +02:00
CalamitousFelicitousness a028b56687 fix(lora): restore native weights when LoRA removed on diffusers-path models
Flux2/Klein loads LoRAs as native modules through the diffusers method
path. network_activate() was only called when new native modules existed,
so removing a LoRA from the prompt left backed-up weights unrestored.

Check applied_layers to detect previously active native modules and
trigger network_activate() for the restore path.
2026-04-29 02:00:33 +01:00
Vladimir Mandic d060d16af5 Merge pull request #4813 from vladmandic/dev
refresh master
2026-04-28 19:33:03 +02:00
Vladimir Mandic 6ddc4ff455 fix history
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-28 19:32:31 +02:00
Vladimir Mandic 29cd811441 Merge pull request #4812 from vladmandic/dev
refresh master
2026-04-28 16:51:30 +02:00
Vladimir Mandic 9cc9acce26 fix history select
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-28 16:29:36 +02:00
Vladimir Mandic 700682247e Merge pull request #4810 from vladmandic/master
refresh dev
2026-04-28 11:14:25 +02:00
Vladimir Mandic fb0ddd3a2d fix ts2utc
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-28 11:00:19 +02:00
awsr 19bc712ecf Fix typing 2026-04-28 01:35:25 -07:00
awsr aff3bf415a Change pip constraints handling...
...and set "uv" and "constraints" parameters to keyword-only
2026-04-28 01:22:27 -07:00
awsr b37fff1237 Update additional argument handling 2026-04-28 01:15:07 -07:00
awsr 77d0061269 Remove leftover useless code 2026-04-28 00:51:52 -07:00
Vladimir Mandic 4001ad55f6 Merge pull request #4807 from vladmandic/dev
merge dev
2026-04-28 09:04:02 +02:00
Vladimir Mandic ff5bdd1b62 update diffusers and extra lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-28 08:58:49 +02:00
Vladimir Mandic d862b15953 Merge pull request #4806 from awsr/callback-order-fix
Fix settings not being initialized for tabs
2026-04-28 08:50:05 +02:00
awsr 65c2129b8a Move functions to match new execution order 2026-04-27 17:15:05 -07:00
awsr 27ddbd60e4 Fix settings not being initialized for tabs 2026-04-27 15:02:41 -07:00
awsr 41157f7426 Fix extension requirements install 2026-04-27 14:20:34 -07:00
Vladimir Mandic bd7cfe1a57 Merge pull request #4804 from awsr/rocm-adv-update
ROCm Adv Mgr: Only autoload if config file exists
2026-04-27 20:23:02 +02:00
awsr 0cb7f426f9 Only autoload if config file exists. 2026-04-27 10:55:53 -07:00
Vladimir Mandic 58377216f1 update diffusers
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-27 07:57:12 +02:00
Vladimir Mandic a654ece3cb Merge pull request #4798 from vladmandic/feat/rife-upgrade
Feat/rife upgrade
2026-04-27 07:17:47 +02:00
Vladimir Mandic 0a02e005ce Merge pull request #4802 from awsr/path-typing
(typing) Update filename / path typing
2026-04-27 07:16:37 +02:00
awsr 3a13d6049d Update filename / path typing 2026-04-26 20:21:00 -07:00
CalamitousFelicitousness ba4436916d fix(control): prevent duplicate save_video and unmask video module shadow
When a video script (animatediff, text2video, image2video, stablevideodiffusion)
runs via Control tab, both the script's save and control_run's end-of-run save
fired. The latter crashed silently because the local `video` cv2 capture name at
control_run:584 shadowed the modules.video import, so the duplicate was hidden
and the gallery video link never propagated.

- alias import as video_module to bypass the shadow
- p.video_saved marker set by each script
- control_run skips its end-of-run save when the marker is set
2026-04-27 01:32:30 +01:00
CalamitousFelicitousness b48bf5236b fix(ltx): handle PIL list output from refine path in interpolation wiring
LTX refine pipe uses output_type='pil' so result.frames[0] returns a list, not a 5-D tensor. Convert via images_to_tensor before the helper sees it, mirroring what save_video already does for the same input.
2026-04-27 01:13:47 +01:00
Vladimir Mandic c85cf0dec3 fix monitor loop
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-26 10:02:00 +02:00