25 Commits

Author SHA1 Message Date
Ryan Meador 6013110e96 fix: honor offline mode in model loaders 2026-09-06 10:10:36 -04:00
CalamitousFelicitousness 9c11929780 fix(ltx): place the 0.9 latent upsampler on the compute device
Its 2.x sibling always did, so only the 0.9 path hit a cpu weight against cuda
latents. Also logs why a run is refused, which until now travelled only in the
raised error.
2026-08-19 01:45:46 +01:00
CalamitousFelicitousness bd0ea5ee1b fix(ltx): resolve every conditioning source the same way
The gallery branch took an upload handle or a PIL image, so an encoded string
fell through to .convert and was logged as a failed condition. Strings now go
to the api decoder, which reads base64 and upload refs rather than paths.
2026-08-19 01:45:46 +01:00
CalamitousFelicitousness bd6abfc3e4 fix(video): resolve dropdown model selection through the registry
Both load buttons matched the dropdown value against the raw row list, so the
separators the list uses for grouping resolved to a row with no repo. The
loader returned early on that row without loading or reporting, and the ltx
tab went on to record load and offload timings for a load that never ran.

Selection now goes through models_def.find, which knows a separator names no
model, and both buttons say what happened. The ltx button had no output bound
at all, so its message went nowhere.
2026-08-18 00:46:16 +01:00
CalamitousFelicitousness 45fc1a0243 fix(ltx): scope cached upsamplers and scheduler overrides to the run
The sampler shift override looked for flow_shift, which only UniPC-style
schedulers declare, so it never reached the flow-match schedulers 2.x uses.
Config keys are now restored only when the run wrote them, and a cached
upsampler is rebuilt once its repo or the model's VAE changes.
2026-08-14 03:39:01 +01:00
Vladimir Mandic e280938e79 add prompt enhance to ltx and fix audio
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-28 13:11:21 +02:00
Vladimir Mandic b7944a1be9 video model loader
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 11:26:33 +02:00
CalamitousFelicitousness b02a480e08 feat(ltx): wire last-frame conditioning into LTX tab
The LTX tab already collected a last-frame image but anchored every condition at index 0, so it never acted as a last frame. Build a separate condition for it at the final frame: index -1 for the 2.x family (latent index, negatives wrap) and num_frames-1 for 0.9 (pixel index). The Last image input now shows only for Condition models, the pipelines that accept multi-frame conditioning.
2026-06-30 23:00:36 +01:00
CalamitousFelicitousness f79e466183 refactor(ltx): rename temp_scheduler_opts to ltx_scheduler_opts
Per PR #4783 review; namespace the helper with the module.
2026-04-21 02:13:09 +01:00
CalamitousFelicitousness 7be6250b7a refactor(ltx): extract temp_scheduler_opts context manager
Collapses the scheduler + shared.opts snapshot/mutate/restore block in
run_ltx into a single `with temp_scheduler_opts(...)` statement. Same
five pieces of state are snapshotted and restored as before; the
mechanism is unchanged per PR #4783 thread 2 feedback, only readability.
2026-04-20 00:28:30 +01:00
CalamitousFelicitousness 7e5d040c4c refactor(ltx): address PR #4783 review threads 1, 3-6
LTXCaps gains a `variant` field ('0.9', '2.0', '2.3') replacing
`is_ltx_2_3`; variant-specific branches check `caps.variant == '2.3'`
instead of grepping the model name.

ltx_util.load_upsample_2x mirrors load_upsample's contract so the 2.x
path owns a module-level cache and stops reloading ~2.3 GB every run.
The cached pipe is stamped with a synthetic
`CheckpointInfo('ltx-upsampler-2.x')` so it gets its own OffloadHook
slot and can go through apply_balanced_offload without invalidating
the main pipe's module map. The hardcoded `.to('cpu')` and post-pass
torch_gc are gone; the second apply_balanced_offload handles spill.

video_overrides comment on OzzyGT LTX-2.3 connectors states plainly
that mirrors pack weights twice by design; ignore_patterns is the
surgical workaround, not an hf_hub bug.

Drive-by: load_upsample log line used `__class__.__name__` (always
'type'); switched to `__name__`.
2026-04-20 00:26:15 +01:00
CalamitousFelicitousness 05abd99285 fix(video): invalidate ltx cache on pipe-class mismatch
Move cache tracking from ltx_util into video_load where shared.sd_model
lives, and invalidate the name-based hit when the cached class no longer
matches the current pipeline (e.g. after Unload Models triggers an
auto-reload of the default checkpoint).

- Drop the duplicate module-level loaded_model cache in ltx_util
- Add a pipe-class isinstance check around the cache hit in video_load
2026-04-19 03:36:16 +01:00
CalamitousFelicitousness acac6157b0 refactor(ltx): unify tab across 0.9.x and 2.x pipeline families
Rework the LTX Video tab so one UI handles every registered variant
(0.9.0 through 2.3, Dev/Distilled/SDNQ-4Bit, T2V/I2V/Condition). Per-
variant behavior is driven from a single capability lookup rather than
substring matching on model names scattered across the backend.

- modules/ltx/ltx_capabilities.py: new module computing family, is_i2v,
  distilled, supports_input_media, supports_multi_condition,
  supports_image_cond_noise_scale, supports_decode_timestep,
  supports_stg, supports_audio, supports_frame_rate_kwarg, and the
  default CFG / steps / sampler_shift for a given model name by reading
  its registered repo_cls in models_def.

- modules/ltx/ltx_ui.py: capability-gated UI. Selecting a model rewires
  accordion visibility, slider interactivity, and defaults via a single
  model.change handler. New controls: dedicated image input slot inside
  the LTX tab (replaces the disconnected shared init_image for I2V),
  condition strength slider, CFG / sampler shift / dynamic shift
  sliders that were previously unreachable. Input media accordion
  restructured so the image slot is always-visible while the video /
  gallery prefix tabs only appear on Condition pipelines.

- modules/ltx/ltx_process.py: route the base pass through
  processing.process_images(p) so LTX inherits standard scheduler
  wiring, extra_networks activation, VAE handling, and error plumbing
  from StableDiffusionProcessingVideo. The multi-pass latent path
  (upsample / refine) stays on direct pipeline calls for latent
  re-entry. Refine noise control gets family-specific kwargs:
  denoise_strength for 0.9.x LTXConditionPipeline, noise_scale for all
  2.x pipelines; the prior strength= injection crashed on 2.x and only
  affected conditioning intensity on 0.9.x. Add torch_gc between every
  stage boundary (base to upsample to refine to vae decode) so the
  CUDA allocator cache does not retain the prior pass's allocations
  across stages. Remove the TypeError fallback that silently passed
  raw latents to save_video when VAE decode returned None on OOM;
  those errors now surface cleanly.

- modules/ltx/ltx_util.py: get_conditions grows a family parameter and
  builds LTX2VideoCondition (frames, index, strength) for 2.x or
  LTXVideoCondition (image, video, frame_index, strength) for 0.9.x.
  get_bucket floors to max(32, vae_spatial_compression_ratio) since LTX
  pipelines validate divisibility by 32 regardless of family.

- modules/video_models/video_overrides.py: extend the I2V generator
  reset to cover LTX2ImageToVideoPipeline and both Condition classes.
  Keep the strength= kwarg injection gated to 0.9.x
  LTXConditionPipeline only; LTX2ConditionPipeline.__call__ does not
  accept it (per-condition strength lives on the LTX2VideoCondition
  dataclass instead).
2026-04-17 00:37:15 +01:00
CalamitousFelicitousness 11b42fdcab fix(video): reset ltx loader cache on unload 2026-04-15 23:03:07 +01:00
Vladimir Mandic e5c494f999 cleanup logger 2026-02-19 11:09:13 +01:00
Vladimir Mandic a3074baf8b unified logger 2026-02-19 09:46:42 +01:00
Vladimir Mandic 05b919f35b ltx2 improvements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-01-16 17:31:56 +00:00
Vladimir Mandic 4b95d72d45 video tab layout
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-10-18 14:07:52 -04:00
Vladimir Mandic 070edb20b0 update transformers and fix quant params
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-10-16 09:21:20 -04:00
Vladimir Mandic 50c3385cf9 fix ltx model selection
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-10-05 20:17:32 -04:00
Vladimir Mandic 175e9cbe29 cleanup/refactor state history
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-09-12 16:12:45 -04:00
Vladimir Mandic 935a4a0aa3 add wan 2.1 text-to-image
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-07-14 13:47:14 -04:00
Vladimir Mandic 091bbd7bc6 video tab redesign and optimized ltxvideo
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-07-10 11:43:44 -04:00
Vladimir Mandic 8062345874 linting
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-07-09 18:19:20 -04:00
Vladimir Mandic 3f5ab15f64 ltx-conditioned prototype
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-07-09 18:11:51 -04:00