Commit Graph

13060 Commits

Author SHA1 Message Date
CalamitousFelicitousness 5cf46d2f81 feat(ltx): canonical LTX-2.x Stage 2 recipe (LoRA + guidance + connectors)
Implement the Lightricks two-stage recipe (diffusers PR #13217) for the
LTX-2.x Dev family: Stage 1 at half-res with full four-way guidance,
2x latent upsample, Stage 2 with distilled LoRA + scheduler swap + identity
guidance on STAGE_2_DISTILLED_SIGMA_VALUES.

Extends to both LTX-2.0 and LTX-2.3 Dev via per-family distilled-LoRA
repos carried on the caps; Distilled variants take the same flow minus
the LoRA swap. Auto-couples Refine with a fixed 2x upsample on any Dev
variant with a known LoRA when the user enables Refine without Upsample.

- caps: is_ltx_2_3, use_cross_timestep, default_dynamic_shift,
  stage2_dev_lora_repo, supports_canonical_stage2, modality_default_scale,
  guidance_rescale_default; LTX-2.x defaults realigned to canonical
  cfg=3.0 / steps=30; per-variant STG block and four-way guidance wired
  for non-distilled 2.x
- process: canonical Stage 1/Stage 2 helpers, scheduler + opts snapshot
  under try/finally, per-family upsampler repo, audio latents threaded
  from Stage 1 into Stage 2, use_cross_timestep gated per caps
- overrides: skip the redundant unsharded LTX-2.3 connectors blob and
  share LTX2TextConnectors weights across 2.3 variants when te_shared_t5
- load: Gemma3 shared-TE path for LTX-2.3; gate use_dynamic_shifting=False
  override to 0.9.x only so LTX-2.x stays on its canonical token-count
  dynamic shift
2026-04-19 03:37:25 +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 ca93f0b9b6 fix(video): correct pipeline classes for ltx 2.3 i2v and condition variants
The 2.3 I2V variants (Dev, Distilled, SDNQ-4Bit, Distilled SDNQ-4Bit)
were registered against LTX2Pipeline, whose __call__ does not accept an
image kwarg; init images were silently dropped. Route them through
LTX2ImageToVideoPipeline instead.

Also register the four 2.3 Condition variants under LTX2ConditionPipeline
so the multi-condition (image/video/gallery prefix) generation path is
reachable on LTX 2.3.
2026-04-17 00:37:15 +01:00
CalamitousFelicitousness 2f00a5764d fix(video): friendlier error messages for missing inputs
Replace "init image not set" / "last image not set" with actionable
messages that tell the user what to do. Matches the phrasing used by
the Caption tab for the same failure class.
2026-04-17 00:37:15 +01:00
Disty0 241d6a291e Expose FP8 E3 2026-04-17 02:06:14 +03:00
Disty0 33726b5019 Update triton mm config 2026-04-16 20:51:10 +03:00
vladmandic 04b8056508 fix typo in ernie
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-16 10:41:10 +02:00
vladmandic 4a7148cc5a update requirements
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-16 08:16:59 +02:00
vladmandic 7061672252 add ltx-2.3-1.1
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-16 08:15:46 +02:00
vladmandic d1fb1b47a8 ernie enable/disable built-in pe
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-16 07:48:09 +02:00
Disty0 eba2c3a8a3 SDNQ update RDNA2 detection 2026-04-16 08:34:17 +03:00
CalamitousFelicitousness 0541843a86 fix(video): resolve outdir_video against outdir_samples 2026-04-15 23:03:15 +01:00
CalamitousFelicitousness 11b42fdcab fix(video): reset ltx loader cache on unload 2026-04-15 23:03:07 +01:00
Disty0 85ec9bf137 SDNQ fix post load quant 2026-04-16 00:38:54 +03:00
Disty0 ed5019116b cleanup 2026-04-16 00:25:21 +03:00
Disty0 9960b371d1 cleanup 2026-04-16 00:22:52 +03:00
Disty0 68a5fe6342 SDNQ add fp8 mm info to modules_quant_config 2026-04-16 00:18:42 +03:00
Vladimir Mandic bb07443995 Merge pull request #4771 from liutyi/dev
Nucleus cover image
2026-04-15 22:33:18 +02:00
Disty0 8a1743712a SDNQ disable FP8 MM on dynamic quant with unsupported GPUs 2026-04-15 23:28:20 +03:00
Disty0 202f12ea6c SDNQ disable fp8 mm with pre-quants on unsupported gpus 2026-04-15 23:12:46 +03:00
Oleksandr Liutyi f719539982 Nucleus cover image 2026-04-15 19:47:03 +00:00
Vladimir Mandic 94d378651e Merge pull request #4770 from liutyi/dev
ERNIE cover images
2026-04-15 20:40:07 +02:00
vladmandic 3e094d394a cleanup changelog
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-15 19:58:49 +02:00
Oleksandr Liutyi c491e65829 ERNIE cover images 2026-04-15 14:41:18 +00:00
vladmandic e6f7017b0d update changelog/todo
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-15 15:22:31 +02:00
Vladimir Mandic eab583ad4b cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-15 12:32:21 +00:00
Vladimir Mandic 69d370d8da update reference data and enable preview for ernie and nucleus
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-15 12:22:53 +00:00
Vladimir Mandic c86ba31214 add nucleus-image
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-15 11:49:10 +00:00
Vladimir Mandic db8c6e9243 add ernie-image
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-15 11:06:32 +00:00
vladmandic d29c133891 validate reference, lint and update diffusers
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-15 10:10:05 +02:00
vladmandic 1a2d255bba update changelog
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-15 09:46:17 +02:00
vladmandic c2dd402f17 update samplers hijack
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-15 09:44:32 +02:00
Vladimir Mandic f1304b3ba0 Merge pull request #4762 from awsr/hashcache
Update hash cache
2026-04-15 09:42:35 +02:00
Vladimir Mandic a26cdca849 Merge pull request #4767 from vladmandic/feat/zimage-native-adapters
Feat/zimage native adapters
2026-04-15 09:36:57 +02:00
Vladimir Mandic c7521f4da4 Merge pull request #4756 from vladmandic/feat/civitai-base-models
feat(civitai): enrich base-model discovery with github constants
2026-04-15 09:34:04 +02:00
Vladimir Mandic 3739456639 Merge pull request #4766 from awsr/patch-1
Support upcoming Civit AI frontend split
2026-04-15 09:32:50 +02:00
Vladimir Mandic 4da4fb94ae Merge pull request #4763 from resonantsky/dev
sd_samplers_diffuse.py patch in response to issue #4761
2026-04-15 09:13:16 +02:00
CalamitousFelicitousness ac78d904b3 refactor(civitai): split base-model helpers into basemodels_civitai
Addresses #4756 review: keeps client_civitai focused on the HTTP client
surface. Behavior unchanged.
2026-04-14 23:26:01 +01:00
CalamitousFelicitousness 5d9b8d2e34 feat(civitai): enrich base-model discovery with github constants
CivitAI removed enum validation from /api/v1/models?baseModels=X (now
returns 200 with empty items on unknown values), which left the
base-model filter dropdown empty. Fix in two parts.

1. Point the base_models discovery probe at /images instead of /models.
   /images still returns a ZodError with the full enum list (82 names
   at time of writing). The existing parser handles the shape unchanged.

2. Also fetch civitai/civitai's base-model.constants.ts from GitHub and
   merge per-name metadata (group, ecosystem, engine, family, hidden)
   into a new base_models_info field on the response. The live probe
   remains authoritative for which names exist; GitHub provides the
   metadata and doubles as a fallback name list if the probe comes back
   empty.

Backward compatible: the existing base_models list keeps the same
shape. Clients that want grouped dropdowns, hidden-flag filtering, or
image/video separation can consume base_models_info instead.

The GitHub fetch has a separate 6h cache since these constants change
much less often than the probes it sits alongside.
2026-04-14 23:26:01 +01:00
CalamitousFelicitousness 65e59e7224 feat(lora): z-image native lokr, loha and oft loaders
Add three adapter families to the z-image native loader and chain them
with the existing lora path through load_safetensors. Mixed-family
files (for example gta6_amateur_photography_zimagebase_v2.safetensors,
which carries lora and lokr groups in the same file) now load
completely instead of having one family silently dropped.

Shared helpers in pipelines/z_image/zimage_lora.py parse keys by
suffix list, rename legacy attention.out and attention.wo to
attention.to_out.0, and split fused attention.qkv into to_q/k/v. For
lora the split chunks the up weight along dim 0. For lokr the split
emits three NetworkModuleLokrChunk entries that share the tensors and
slice the kronecker product at apply time.

Fused attention.qkv for loha and oft is skipped with a warning. No
NetworkModuleHadaChunk exists, oft rotations are tied to out_features
and cannot be cleanly split across q/k/v, and no real z-image adapter
in that layout exists today.

load_safetensors for zimage chains try_load_lora, try_load_lokr,
try_load_loha and try_load_oft and merges their module dicts into a
single Network so mixed files load every module.
2026-04-14 21:48:19 +01:00
CalamitousFelicitousness c35adc4d0d feat(lora): native z-image lora loader
Add zimage to allow_native so lora_force_diffusers picks between
native and diffusers. Before this, zimage always took the diffusers
path regardless of the setting.

pipelines/z_image/zimage_lora.py reads the safetensors and writes
directly into network_layer_mapping, so Z-Image LoRAs no longer go
through the diffusers PEFT converter that raised KeyError on
state dicts with partial alpha keys.

Key formats handled: ai-toolkit, kohya lora_unet_, bare transformer.
and no-prefix. Pre-refactor fused attention.qkv is split into
to_q/k/v; attention.out and attention.wo are renamed to
attention.to_out.0. Alpha and dora_scale are preserved.
2026-04-14 21:13:23 +01:00
awsr 03486deca6 Support upcoming site frontend split
API endpoints are supposed to remain the same, so those don't need updating.
2026-04-14 12:46:12 -07:00
resonantsky 512051bafa samplers: fix UniPCMultistepScheduler sigmas device mismatch at step >= 2
upstream UniPCMultistepScheduler.set_timesteps unconditionally moves self.sigmas to CPU after building them. multistep_uni_p_bh_update / multistep_uni_c_bh_update then constructs a torch.ones(..., device=sample.device) tensor and calls torch.stack([..., self.sigmas[...]]) — crashing at inference step >= 2 whenever the model runs on a non-CPU device (CUDA, ROCm, MPS).

Monkey-patch set_timesteps so that, after the upstream call, self.sigmas is moved back to the requested device. Applied once at import time inside the existing sampler-load try/except block so failures are silent-logged and never break the rest of the sampler registry.
2026-04-14 14:35:29 +02:00
awsr c8e3473e93 Minor cleanup 2026-04-14 05:22:07 -07:00
vladmandic 101bd64b8c update todo/changelog
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-14 14:05:32 +02:00
vladmandic 58649a7935 trivial prompt-to-json
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-14 13:59:56 +02:00
vladmandic 0a15030067 error checks for fibo
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-14 13:45:33 +02:00
vladmandic afd246d062 fix vibe installer
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-14 13:24:09 +02:00
vladmandic 6f471f9050 install vibe on-demand
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-14 13:20:12 +02:00