Commit Graph

9129 Commits

Author SHA1 Message Date
CalamitousFelicitousness f01e752b06 fix(video): take the audio rate from the loaded vocoder
Pipelines rarely report a sample rate, so the save path fell back to 24000.
LTX-2.3 and 2.5 run at 48k, and muxing at half the rate drops the track an
octave. The rate now comes from the vocoder, as the LTX tab already did.
2026-08-14 03:39:01 +01:00
CalamitousFelicitousness 780495ff2e feat(video): allow a transformer folder to load into another argument
The subfolder name doubles as the pipeline argument, so a repo shipping a
second transformer beside the default one had no way to load it: the argument
was dropped and the default weights stayed. dit_kwarg names the argument when
it differs from the folder.
2026-08-14 03:39:01 +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
CalamitousFelicitousness 5735b8f47d fix(ltx): pin guidance and cross-timestep on every 2.x call path
Some paths left both to pipeline defaults, which track the current upstream
model: distilled picked up guidance it already bakes in, and 2.0 could land on
2.3's joint-sigma path.
2026-08-14 03:39:00 +01:00
CalamitousFelicitousness 5c495c29cd fix(video): assign the loaded modular pipeline to the model slot
The modular branch returned the pipe instead of assigning it, so the video
tab and the API failed with "model not loaded" and the whole post-load tail
was skipped along with it.
2026-08-14 01:27:53 +01:00
CalamitousFelicitousness ca7f2cc01f fix(video): hide minimax from the generic engine dropdown 2026-08-14 01:15:40 +01:00
CalamitousFelicitousness 9d81ec0d54 docs(video): correct the shared encoder note in the modular preload 2026-08-14 01:14:31 +01:00
CalamitousFelicitousness c04fe7c9db fix(video): exclude dropdown separators from model resolution
The registry helpers filtered only the 'None' placeholder, so the eleven
LTX separator rows resolved as models and a POST naming one reached
load_model with a null repo. is_model() now covers both sentinel kinds.
2026-08-14 01:14:27 +01:00
Vladimir Mandic e72dee3fe1 Merge pull request #5023 from vladmandic/fix/video-ignore-patterns
fix(video): honor ignore patterns when fetching a pipeline repo
2026-08-13 21:39:06 +02:00
Vladimir Mandic a2b2f25f27 lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-13 21:32:10 +02:00
Vladimir Mandic a153ee6a17 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-13 20:38:16 +02:00
Vladimir Mandic 181065f069 minimax image and reference
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-13 20:15:32 +02:00
CalamitousFelicitousness 42c9038146 fix(video): honor ignore patterns when fetching a pipeline repo
DiffusionPipeline.download derives ignore_patterns from the passed components and
never reads the caller's, so the kwarg set in load_override was inert and diffusers
logged it as an unexpected keyword. The unsharded connectors duplicate it was meant
to skip was fetched on every LTX-2.3 mirror load.

Resolve the repo to a snapshot built from those patterns and hand from_pretrained
the folder instead of the id. That skips its download path, so the passed component
folders it would have pruned are pruned here instead. The connectors override drops
its own copy of the kwarg, which ModelMixin never read either.
2026-08-13 17:37:18 +01:00
Vladimir Mandic ad6f3d3e11 minimax ui
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-13 15:33:47 +02:00
Vladimir Mandic 0ddd0f7091 minimax-h3 i2i
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-13 11:23:57 +02:00
Vladimir Mandic 3f69bee9dd refactor modular
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-12 14:24:09 +02:00
CalamitousFelicitousness d62ca45eaa refactor(video): load the modular denoiser and text encoder through the shared loaders
Selected from the specs the pipe already declares, update_components first and
load_components for the rest, so only what the workflow declares gets fetched. Weights
land in hfcache. Covers the TODO on component names.

Encoder sharing left off: shared_te_map matches a substring of the repo name and 4b hits
_dynamic_4bit, redirecting Qwen3-VL to another repo.
2026-08-12 03:17:45 +01:00
CalamitousFelicitousness 113a74d91a fix(model): treat an unpopulated modular pipeline as not loaded
None from a family loader means unhandled, so the chain falls through to the folder
loader, which for a modular pipe builds an object holding only its from_config helpers
and installs it. Refuse it when none of the from_pretrained specs materialized.
2026-08-12 03:17:45 +01:00
CalamitousFelicitousness 5ac87e105d fix(video): fail the load when a modular component is missing
load_components leaves a failed component as None and carries on, so the pipe reaches
generation short of one and fails somewhere unrelated. Compare against what the workflow
declares and refuse a pipe missing any of it. The conditioner fallback goes too, since
loading it another way just defers the failure into generation.
2026-08-12 03:17:45 +01:00
Vladimir Mandic e962970f53 cleanup move_model
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 23:42:07 +02:00
Vladimir Mandic a175113ac8 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 23:31:08 +02:00
Vladimir Mandic aa602c66c1 tweak diffusers/transformers logging
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 23:06:20 +02:00
Vladimir Mandic f92ef90d3d update offloading codepaths for non-balanced
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 22:09:12 +02:00
Vladimir Mandic 5123bfd96b cleanup minimax
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 15:42:29 +02:00
Vladimir Mandic 1ca694aa26 Merge pull request #5017 from vladmandic/feat/minimax-h3
Feat/minimax h3
2026-08-11 13:34:36 +02:00
Vladimir Mandic 3f9649726a rocm logging
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 13:32:45 +02:00
Vladimir Mandic 1c8885f425 download model index ondemand
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 12:55:59 +02:00
Vladimir Mandic c1741bc7f0 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 11:27:50 +02:00
Vladimir Mandic ed6eb2ea0a Merge pull request #5016 from vladmandic/feat/offload-engine
feat(offload): per-component group offload engine and memory observability
2026-08-11 11:26:56 +02:00
Vladimir Mandic 0608bdfbb1 log torch.accelerator
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 11:26:27 +02:00
Vladimir Mandic ff83baf2ee fix autotune progressbars
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 10:57:36 +02:00
Vladimir Mandic 431774e6e2 fix progress in legacy tabs
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-11 10:41:34 +02:00
CalamitousFelicitousness 3e8f0372ad feat(video): condition minimax h3 ref2va on reference images
The ref2va checkpoint partition conditions on reference images instead
of keyframes, so it gets its own registry row and reference card, and
the video core marshals PIL images into task_args as
MiniMaxH3ImageReference. Images are converted to RGB first, since the
reference encoder reads the array raw. The keyframe path is unchanged.

Validation runs before the model load in one funnel shared by the tab
and the API, so a rejected request costs nothing: references on a
non-reference model, a reference model with nothing to condition on,
more than nine images, non-images, and aspect outside 1:4 to 4:1 all
return 400. The image path rejects a reference pipe without references
instead of reaching a transformer that was never loaded.
2026-08-10 22:14:18 +01:00
CalamitousFelicitousness ff42f1631c feat(api): add video generation endpoint
Add POST /sdapi/v1/video plus GET /sdapi/v1/video/models and
GET /sdapi/v1/video/file. The generation body is extracted from the
gradio handler into a keyword-only core, video_run.run, which returns a
structured result and raises typed errors; the positional generate
signature is unchanged and now adapts to the core. Omitting engine and
model drives the currently loaded checkpoint when it is video-capable,
which covers models loaded from local folders without a registry entry.

- registry helpers in models_def (find, engines, pipeline_classes,
  workflow_for_class); validate_pipeline reuses the shared class set
- modular pipes stamp their workflow so out-of-registry loads dispatch
  onto the modular branch
- disk switches (mp4_*) and wire switches (send_*) are independent;
  artifacts above the base64 cap fall back to path plus the file route,
  which is jailed to the video output directory and serves video/mp4
  with range support
- always-on video scripts get bootstrapped default args, matching the
  txt2img handler; missing bootstrap raised a TypeError per frame
- checkpoint overrides are rejected with a pointer to the checkpoint
  endpoint; unknown engine, model and sampler names return 404 with the
  valid choices
- cli/api-video.py client, test/test-video-api.py suite and a
  full-test.sh entry; video mimetypes registered; rate-limit cost set
- remove the unreferenced video_ui.run_video dispatcher
2026-08-10 22:14:18 +01:00
CalamitousFelicitousness 815d47f0c1 fix(video): request the default sampler for minimax h3
The modular override forces Default instead of the None sentinel:
Default restores the model's own scheduler, which is the bespoke pair.
The reference entries request sampler: Default to match.
2026-08-10 22:14:18 +01:00
CalamitousFelicitousness e88815fe11 fix(model): skip auth check for local modular pipeline folders
The local-folder skip in hf_auth_check keyed on model_index.json only,
so modular pipeline folders fell through to a hub auth check with a
filesystem path as the repo id.
2026-08-10 22:14:18 +01:00
CalamitousFelicitousness 9e72bebc8c fix(model): make saved modular pipelines self-contained and listed
Saving a modular pipeline now rewrites the component references in its
index to the destination folder, so a reload uses the saved quantized
weights instead of following the specs back to the source repositories.
The folder scan accepts modular_model_index.json for direct folders,
matching the snapshot branch, so saved pipelines list in the model
dropdown.
2026-08-10 22:14:18 +01:00
CalamitousFelicitousness 5b51e863ff fix(model): tolerate empty prompts on minimax h3
An empty prompt tokenizes to zero tokens and the conditioner fails
reshaping an empty sequence; a single space keeps the generate-on-empty
behavior other models have.
2026-08-10 22:11:57 +01:00
CalamitousFelicitousness 5fdf01ff05 feat(video): stage labels for modular generation progress
Modular pipelines run every stage inside one pipeline call, leaving
the ui on a single inference label. Forward hooks on the text encoder,
transformer and vae decoders now surface the current stage through
shared state, and the interrupt check runs in every stage so encodes
and tiled decodes abort promptly.

- saving a model registers a job instead of appearing idle
- group offload logs each component before the pin step instead of
  only after completion
2026-08-10 22:11:57 +01:00
CalamitousFelicitousness 1f232f43ef fix(video): keep the conditioner vision tower unquantized
The modular text encoder quant config now excludes the vision tower.
The default skip pool covers diffusion module names, so qwen-vl vision
blocks quantized alongside the language layers; vision blocks have no
validated quantization precedent and run only for keyframe workflows.
2026-08-10 22:11:57 +01:00
CalamitousFelicitousness 1e1badd589 fix(model): list base-registered modular pipelines in the dropdown
Modular pipelines flagged as base models in the video registry cache
into the diffusers folder, so the folder scan and the model dropdown
pick them up once downloaded and the reference card reports them as
ready; video-only models keep caching into the shared cache and stay
out of the dropdown. The snapshot scan accepts modular_model_index.json
when the plain index is absent.
2026-08-10 22:11:57 +01:00
CalamitousFelicitousness d0da21adce feat(video): quantize modular components on load
The modular loader passes sdnq quantization configs to load_components
as a per-component dict: transformers take the model config, the text
encoder takes the te config, and components without an entry load
unquantized. Pre-quantized repositories keep their own config, which
diffusers detects before a passed config applies.
2026-08-10 22:11:57 +01:00
CalamitousFelicitousness 6375b42ff7 feat(model): register minimax h3 as a text2image base model
Reference entries for the bf16 repo and the sdnq uint4 quant load the
modular pipeline through the standard dispatch. Image tabs run the
model in still mode with audio off; the video tab keeps its own
overrides through the shared per-generation hook. Detailer is not
supported and is disabled with a warning.
2026-08-10 22:11:57 +01:00
CalamitousFelicitousness c9e1398c71 feat(video): add minimax h3 joint video and audio model
First natively modular model: the pipeline is driven directly through
ModularPipeline, with components fetched per workflow (fl2va covers
text and first/last-frame conditioning).

- per-generation overrides snap the canvas to /32, align frames to
  the 17n+5 grid and duration window, and keep the bespoke scheduler
  pair
- group offload for modular pipelines applied per component in
  sd_offload; re-application is a guarded no-op
- audio checkbox pops the audio decode block so decode and muxing are
  skipped
- frames=1 renders a single still image: the duration floor lifts per
  instance and sub-floor latents pad at the vae decoder
- progress and interrupt handling via a transformer forward pre-hook
- vae scale factor override, tuple-safe patch size
2026-08-10 22:11:57 +01:00
CalamitousFelicitousness d38f2c97b2 feat(monitor): report model placement in the memory monitor
Move the per-component placement walk from the api server into memstats
next to ram and gpu stats, and add it to the --monitor tick so offload
placement is visible in a log rather than only over the api.

- guard the walk internally: the supervisor loop logs its monitor line
  unguarded, and the walk can race a reload or an offload rewrap
- monitor reports gb and merges into a fresh dict, since memory_stats
  returns a module global that the per-generation log also prints
- endpoint keeps reporting raw bytes
2026-08-10 22:10:42 +01:00
CalamitousFelicitousness b12cbcb523 feat(api): report model memory placement in memory endpoint
Add a model section to /sdapi/v1/memory with loaded-model bytes summed
per pipeline component and device, so clients can tell resident weights
from offloaded ones and loop-critical components from edge ones.

- walk components over parameters and buffers, dedupe shared storages,
  key by component name then device type
- read the raw model slot so a memory poll never triggers a model load
- section is exception-isolated like ram and cuda; reports an error
  string if the walk races a reload
2026-08-10 22:10:42 +01:00
CalamitousFelicitousness 7cd9fbc321 fix(offload): budget pinned memory from available ram
The guard compared component size against half of total system memory and
silently dropped to unpinned streaming above that. Total is the wrong
quantity: a component that fits comfortably in free memory gets denied, and
unpinned leaf streaming is slow out of proportion to its size because every
per-leaf transfer pays staging cost.

Budget against memory free at apply time less a reserve, and cache the
verdict on the module since a granted pin lowers the same reading it derives
from. A denied pin now also drops streams and falls back to block_level,
since leaf plus stream is only the right shape when weights are pinned, and
logs the per-step transfer volume so the cost of the slow path is visible up
front.
2026-08-10 22:10:42 +01:00
CalamitousFelicitousness 5a66d9eabe fix(offload): reclaim model memory across switches
Model switches kept most of the previous model resident, and the next
load could stall in kernel reclaim while the freed memory was still held.

- strip group offload hooks in disable_offload so the meta move at unload
  actually frees component weights; hook removal resolves wrapper
  components that carry hooks on the inner model
- flush the torch pinned host cache in torch_gc so freed streaming
  buffers return to the OS instead of staying cached in-process
- skip the pipe-level accelerator move for group-managed pipes: the
  offload engine already placed every component, and the move only
  dragged on-demand components to the accelerator for the trailing
  eviction to undo
2026-08-10 22:10:42 +01:00
CalamitousFelicitousness 37f005a5d2 fix(offload): skip accelerator pre-moves of on-demand components
Tab runners pre-move the vae module to the gpu before generation,
which parks an on-demand component on the accelerator for the whole
denoise. Moves of a stamped module toward the accelerator now return
early; the entry bridge onloads it when its encode or decode runs.
2026-08-10 22:10:42 +01:00
CalamitousFelicitousness 0b3ec59988 fix(offload): report per-component stats under group offload
The per-component stats block printed only from the balanced offload
path, so group mode loads showed no component classes, sizes or
quantization. Group and modular applies now print the same block once
per loaded model, with sizes measured directly when no balanced hook
map exists.
2026-08-10 22:10:42 +01:00