Commit Graph

13231 Commits

Author SHA1 Message Date
Vladimir Mandic dcc37afabd ernie add lora
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-04 20:45:10 +02:00
CalamitousFelicitousness b37e275212 feat(lora): native loader for ernie-image
Adds pipelines/ernie/ernie_lora.py with try_load_lora/lokr/loha/oft
entry points modeled on the z-image native loader, wires it into
lora_load.load_safetensors, and adds 'ernieimage' to allow_native.

ERNIE attention is not fused (separate to_q/to_k/to_v/to_out.0), so
the loader skips the qkv-split machinery the z-image loader needs and
supports all four families uniformly. Recognized prefixes are
diffusion_model., transformer., and lora_unet_; PEFT lora_A/lora_B
keys are normalized to lora_down/lora_up. Verified against PEFT, LoKR,
and Kohya/AIT files in the wild with zero unmapped or shape-mismatched
modules.
2026-05-04 16:43:36 +01:00
Disty0 cc0f06d64f SNDQ unify Triton MM configs 2026-05-04 15:14:30 +03:00
Vladimir Mandic 580f66c12f gallery add thumbnail size slider
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-04 09:03:50 +02:00
Vladimir Mandic 948082692c Merge pull request #4819 from vladmandic/feat/ltx-audio
LTX Audio and optimisations
2026-05-04 07:37:40 +02:00
CalamitousFelicitousness 4523e7c3ac fix(ltx,processing): address pr #4819 review
review feedback from vladmandic on commit 80fde086f.

- run_ltx: drop the inline random.seed() / randrange resolve and use
  processing.fix_seed(p) right after the StableDiffusionProcessingVideo
  construction. p.seed carries the resolved int across every stage
  (latent_pass, both upsample paths, refine, post-refine vae_decode).
  matches the existing fix_seed(p) call sites in img2img.py:30,
  video_run.py:101, xyz_grid.py:266 and 8 others.

- process_decode: add AudioFrameList(list) subclass and attach_audio
  helper to carry output.audio onto the returned frame list. mirrors
  the existing output.bytes early-return contract: samples.audio
  survives downstream so process_images_inner can collect it via the
  Processed.audio kwarg.

- drop the p.audio_capture transit in process_diffusers and the
  fallback read in process_images_inner. p is input params, not
  output state.
2026-05-04 02:52:42 +01:00
CalamitousFelicitousness 80fde086f9 fix(ltx): close three two-stage audit gaps
- resolve seed=-1 once at top of run_ltx and thread the int through every
  stage (StableDiffusionProcessingVideo, _latent_pass, upsample 0.9/2.x,
  refine, post-refine vae_decode). get_generator(-1) reseeds globally per
  call so each stage was rolling an uncorrelated value; p.seed now carries
  the resolved seed so reruns reproduce.

- pre-encode prompts via shared.sd_model.encode_prompt before the latent
  path; park the four tensors on CPU and pass them as prompt_embeds /
  *_attention_mask kwargs through _latent_pass and refine_args. Stage 2
  reuses Stage 1's embeds instead of re-running the text encoder. The
  manual encode is outside pipe.__call__ so the post-forward offload hook
  never fires; apply_balanced_offload(force=True) re-anchors the device
  map so the text encoder doesn't stay pinned through Stage 1.

- skip audio_vae.decode + vocoder on refine when audio_enable=False:
  output_type='latent' bypasses the internal audio + video decode and
  hands off to the post-refine vae_decode block. Per-step audio
  cross-attention still runs for video conditioning.
2026-05-03 06:18:56 +01:00
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 12ecaab33e kanvas magic-wand on mask layer
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-02 12:12:03 +02:00
Vladimir Mandic 57f5bf5bd5 add missing js files
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-02 10:56:52 +02:00
Vladimir Mandic 823058b15a add prompt-enhance info to metadata
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-02 10:41:01 +02:00
Vladimir Mandic ee5978f72b custom vae loader
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-02 10:22:43 +02:00
Vladimir Mandic e74a9a60e5 fix kandinsky detection
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-02 09:09:06 +02:00
Vladimir Mandic 63190a50e7 fix ernie preview
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-02 08:06:57 +02: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