Commit Graph

440 Commits

Author SHA1 Message Date
CalamitousFelicitousness 7792b1ab62 fix(video): count generated frames on the first output axis
The shape branch read axis 1, which held the frame count back when animatediff
returned (batch, channels, frames, height, width). Diffusers now returns
(batch, frames, channels, height, width) and the modular video path puts
channels last, so axis 1 reads channels or height and the line printed a
plausible wrong number: a 124 frame 1024x576 generation logged frames=576.
len() is the frame count under both layouts and is what the sibling call site
in process_decode already uses.
2026-08-17 03:41:46 +01:00
Vladimir Mandic b0649e0ec1 group offloading changes
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-14 15:59:51 +02:00
Vladimir Mandic 3f69bee9dd refactor modular
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-12 14:24:09 +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
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 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 abfb5ac3ed feat(offload): on-demand vae under group offload
Vae-class components never take group hooks, so group mode kept them
resident on the gpu; a MiniMax-class video vae holds about 10GB that
way while running only seconds per generation. Components above 1GB
now rest in system memory: the apply_forward_hook bridge on encode and
decode fires an on-demand hook that moves the whole module to the
device, so tiled calls find every weight already loaded, and the
processing seams return it to cpu once outputs are materialized. Small
vaes stay resident since the transfer would cost more than it frees.

- placement is decided per component by measured size and requires the
  entry bridge; components without it stay resident
- move_model no longer forces on-demand vaes to the gpu for
  non-txt2img tasks, and full_vae_encode onloads before binding the
  input, which otherwise lands on the resting device
- mode switches clear the stamp and hook in both directions
2026-08-10 22:10:42 +01:00
Vladimir Mandic 9b7a8a3408 skip reapply attention
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-22 20:12:07 +02:00
CalamitousFelicitousness 4554b9a277 fix(lora): apply te networks before encode and honor lora_apply_te
Network activation ran after prompt encoding, so text encoder lora
weights never affected embeds on the first generation and the stale
result was then served from the embed cache. The trailing unfiltered
activate in network_load also overrode the te exclude filter, so the
lora_apply_te setting was never honored.

- parse and activate networks in process_base before pipeline args are built
- activate_filtered gates text encoder components on per-request or global
  lora_apply_te; used by base, hires, detailer and faceid call sites
- network_load accepts activate=False for callers that run their own
  deactivate/activate sequence with include/exclude
- network_activate walks excluded components in restore-only mode so a
  filtered text encoder reverts to backup instead of keeping stale deltas
- loaded_loras cache is single-entry since per-filter entries go stale when
  the setting toggles
- prompt embed cache key includes the effective lora_apply_te value
2026-07-08 03:06:04 +01:00
Vladimir Mandic 8d71d5206d delay init of video models
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-20 10:28:46 +02:00
Vladimir Mandic 84228f1657 update sampler behavior and user definable fallback
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-08 17:00:00 +02:00
Vladimir Mandic 5e99dee3c2 full codespell coverage
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-04 12:36:10 +02:00
Vladimir Mandic f67562b912 - all guidance values set to -1 to enable using model defaults
- log default values used if not overriden by user
- rename inconsistent guidance variables:

p.cfg_scale
p.image_cfg_scale -> p.cfg_image
p.diffusers_guidance_rescale -> p.cfg_rescale
p.pag_scale -> p.cfg_true
p.pag_adaptive -> p.cfg_adaptive

Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-16 11:06:23 +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 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
Vladimir Mandic 63190a50e7 fix ernie preview
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-02 08:06:57 +02:00
Vladimir Mandic 6ddc4ff455 fix history
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-28 19:32:31 +02:00
vladmandic 8070e51777 openvino backend
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-12 19:07:20 +02:00
vladmandic e0faa149dd cleanup
Signed-off-by: vladmandic <mandic00@live.com>
2026-03-13 14:44:58 +01:00
vladmandic f9abe07035 cleanup logging and update requirements
Signed-off-by: vladmandic <mandic00@live.com>
2026-03-13 13:02:41 +01:00
Vladimir Mandic 47543663f9 cleanup references to p.sd_model
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-02-19 20:48:42 +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 6fdd3a53cf reduce mandatory requirements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-02-18 17:53:08 +01:00
vladmandic da1cf2f996 refactor image methods
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-11 12:29:00 +01:00
CalamitousFelicitousness 76aa949a26 refactor: integrate sharpfin for high-quality image resize
Vendor sharpfin library (Apache 2.0) and add centralized wrapper
module (images_sharpfin.py) replacing torchvision tensor/PIL
conversion and resize operations throughout the codebase.

- Add modules/sharpfin/ vendored library with MKS2021, Lanczos3,
  Mitchell, Catmull-Rom kernels and optional Triton sparse acceleration
- Add modules/images_sharpfin.py wrapper with to_tensor(), to_pil(),
  pil_to_tensor(), normalize(), resize(), resize_tensor()
- Add resize_quality and resize_linearize_srgb settings
- Add MKS2021 and Lanczos3 upscaler entries
- Replace torchvision.transforms.functional imports across 18 files
- to_pil() auto-detects HWC/BHWC layout, adds .round() before uint8
- Sparse Triton path falls back to dense GPU on compilation failure
- Mixed-axis resize splits into two single-axis scale() calls
- Masks and non-sRGB data always use linearize=False
2026-02-11 09:57:37 +01:00
vladmandic 363cb175aa allow different lora in hires
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-09 22:31:00 +01:00
awsr 2f8976e28d Type standardization in processing_class 2026-01-21 16:35:19 -08:00
vladmandic deb59c60fc add SD_VAE_DEFAULT
Signed-off-by: vladmandic <mandic00@live.com>
2026-01-04 17:55:01 +01:00
vladmandic 0706f46a91 alias pipeline output image/images
Signed-off-by: vladmandic <mandic00@live.com>
2025-12-13 09:30:05 +01:00
CalamitousFelicitousness 810c00eb12 fix(processing): convert vae_decode results to list in process_decode
The else branch in process_decode was returning a numpy array directly
from vae_decode, while the if branch properly converted results to a
list. This caused process_samples to return early with an empty infotext
list, and zip(numpy_array, []) produced zero iterations, resulting in
images=0 for detailer, inpainting, and img2img operations.

Bug introduced in 3e8dec929 (Dec 2024), exposed by 63a180be1 (Nov 2025).
2025-12-11 03:00:40 +00:00
vladmandic 3a65d561a7 add google-veo-3.1
Signed-off-by: vladmandic <mandic00@live.com>
2025-12-09 19:14:08 +01:00
vladmandic 63a180be13 fix output none
Signed-off-by: vladmandic <mandic00@live.com>
2025-11-24 10:21:44 -05:00
vladmandic b5f000ab8a add xyz and script support to control api
Signed-off-by: vladmandic <mandic00@live.com>
2025-11-23 13:07:42 -05:00
Vladimir Mandic 947e2c7bc5 update chrono pipeline
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-11-10 08:43:50 -05:00
Vladimir Mandic 56026c4e61 refactor attention handling
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-11-08 10:55:41 -05:00
Disty0 c61e34770b revert frame index 2025-11-02 22:25:49 +03:00
Disty0 5ba74b7263 Get the correct frame with Chrono 2025-11-02 19:21:08 +03:00
Vladimir Mandic 495cfd8632 fix cn
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-11-01 12:21:19 -04:00
Vladimir Mandic 372770b285 guard against multi-controlnet in hires
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-10-31 18:41:31 -04:00
Vladimir Mandic 3ae10dd0e1 add nvidia-chronoedit
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-10-30 19:52:29 -04:00
Vladimir Mandic 4033567d4f controlnet fixes and validation
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-10-30 13:36:58 -04:00
Disty0 f7fef1f5b5 fix hy3 2025-10-30 00:52:43 +03:00
Vladimir Mandic e4711bcb6c add hunyuanimage-2.1
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-10-24 10:29:58 -04:00
Vladimir Mandic eb025eaf31 remove split-attention and add attention slicing option
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-09-28 18:01:34 -04:00
Vladimir Mandic 6f409deedf ui separate guidance and detail sections
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-09-24 12:33:57 -04:00