Commit Graph

8680 Commits

Author SHA1 Message Date
CalamitousFelicitousness f83c1bc731 refactor(sdnq): clean up dynamic loss threshold slider 2026-06-07 00:18:07 +01:00
Vladimir Mandic 78f88ef571 add ideogram4
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-05 20:00:49 +02:00
CalamitousFelicitousness 63fd441a14 refactor(ideogram4): register pipeline and load via from_pretrained
Register the subclass with generic.set_pipeline and build it with
from_pretrained, passing the SDNQ transformers and shared text encoder
while the vae, scheduler, and tokenizer load from the repo.
2026-06-05 02:10:00 +01:00
CalamitousFelicitousness 92e1cb9927 fix(ideogram4): pass JSON captions through unmangled
The dynamic-prompt brace processor in apply_styles_to_prompts strips the
{} and [] out of a JSON caption, leaving non-JSON that trips the model's
weight-baked safety placeholder. Let a model opt out of style and wildcard
processing via keep_prompts and set it for Ideogram4, then normalize the
prompt in encode_prompt: valid JSON to the compact training form, plain
text wrapped into a minimal caption so basic prompts still generate.
2026-06-05 01:54:18 +01:00
CalamitousFelicitousness bcebb6b81b refactor(ideogram4): adopt diffusers-native pipeline
diffusers shipped first-party Ideogram 4 (transformer + pipeline) in
9b0818cf, so drop the in-tree port and keep only SD.Next integration glue.

Bump the diffusers pin to 9b0818cf and build diffusers' Ideogram4Pipeline
from a thin loader with per-transformer SDNQ. A small subclass keeps the
text encoder resident for the Qwen3-VL tap under balanced offload, and the
step callback denormalizes the preview latent from vae.bn before unpatchify.
Deletes the ported transformer, pipeline, scheduler, text encoder, and
latent-norm constants.
2026-06-05 01:54:18 +01:00
CalamitousFelicitousness 4866d2c8f3 fix(ideogram4): offload-safe encode, step progress, live preview
- move the text encoder on-device for the tapped forward (bypasses the offload hook)
- wrap the denoise loop in the diffusers progress bar
- live preview through the shared TAE FLUX.2 decoder (Flux.2 VAE)
2026-06-05 01:54:18 +01:00
CalamitousFelicitousness 2f3d0e719d feat(ideogram4): add Ideogram 4 model support
Diffusers-native port of the 9.3B flow-matching DiT: dual-transformer asymmetric CFG, a 13-layer Qwen3-VL tap encoder deduped with VQA and prompt-enhance, the Flux.2 VAE, and a logit-normal schedule. Loads a published bf16 repo with SDNQ at load.
2026-06-05 01:54:18 +01: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 f25f325efb fixes based on full skills run
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-04 11:10:26 +02:00
Vladimir Mandic e7e317191a automated pipeline registrations and tests
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-04 10:18:09 +02:00
Vladimir Mandic 258d88e6bf fix typo
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-03 09:46:44 +02:00
Vladimir Mandic ec2e37ee6e enhance automated testing
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-03 09:27:34 +02:00
Vladimir Mandic a664c33965 Merge pull request #4891 from ryanmeador/fix/video-thumbnail-toggle
feat(video): add thumbnail save toggle
2026-06-03 08:10:43 +02:00
Vladimir Mandic d89844f145 Merge pull request #4890 from ryanmeador/feat/video-mp4-metadata
feat(video): save prompt metadata in mp4
2026-06-03 08:04:40 +02:00
Ryan Meador 11096bc0aa feat(video): add thumbnail save toggle 2026-06-02 23:43:58 -04:00
Ryan Meador 8085eadffb feat(video): save prompt metadata in mp4 2026-06-02 23:05:47 -04:00
Vladimir Mandic 2af67b76d0 lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-02 17:13:08 +02:00
Vladimir Mandic 35aa8c6422 fix openpose and add test-compile
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-02 17:06:18 +02:00
Vladimir Mandic 3c2a742f40 cleanup logging
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-02 08:03:27 +02:00
Vladimir Mandic bd47b693d2 update transformers and cleanup ui labels
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-02 07:45:37 +02:00
Vladimir Mandic 6afde7e631 Merge pull request #4886 from vladmandic/feat/detailer-postprocess
feat(api): add detailer postprocess script and /sdapi/v1/detail endpoint
2026-06-02 07:15:11 +02:00
Vladimir Mandic 6a1c994cf3 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-01 11:54:26 +02:00
Vladimir Mandic c319f8f92d refactor shared text encoder
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-01 10:03:10 +02:00
Vladimir Mandic 24aced130d Merge pull request #4876 from vladmandic/feat/native-transformer-loader
Feat/native transformer loader
2026-06-01 06:59:47 +02:00
CalamitousFelicitousness f9ab0bf04d feat(api): add detailer postprocess script and /sdapi/v1/detail endpoint
Surface YoloRestorer.restore() as a standalone operation: a Detailer
postprocessing script in the Process tab and a thin /sdapi/v1/detail
endpoint, neither requiring a base generation pass.

- modules/postprocess/yolo.py: YoloRestorer.make_processing() builds the
  synthetic Img2Img processing object both entry points feed to restore(),
  resolving the seed so the inpaint passes are reproducible
- modules/api/process.py: post_detail handler exposes the full detailer
  parameter set and returns the detailed image plus optional annotations
  as base64
- scripts/postprocessing_detailer.py: reuses shared.yolo.ui('extras') and
  runs through make_processing()
- modules/postprocessing.py: run_extras takes a per-script script_args
  dict, also letting the extras API drive other scripts such as Remove
  background; omitting it leaves existing callers unchanged
- modules/api/models.py: ReqDetail / ResDetail
- modules/processing_info.py: guard create_infotext's Image/Hires CFG
  reporting against an unset (None) cfg_image, matching the is-not-None
  checks the other cfg_image readers use; the detailer inpaint pass runs
  with it unset
- test/test-detailer-api.py: covers both paths; effect tests measure the
  diff inside the detected region with extreme isolated parameter values,
  and the suite disables model quantization for the run and restores the
  original settings afterward
2026-06-01 00:25:59 +01:00
Ryan Meador b63e5ceeae fix(ltx): align cached prompt tensors with device 2026-05-31 17:52:44 -04:00
Vladimir Mandic c3eec8e60b Merge pull request #4884 from vladmandic/fix/output-paths-base-relative
fix(paths): don't create per-type output dirs at root when base set
2026-05-31 06:47:53 +02:00
CalamitousFelicitousness 0acfc70c42 fix(paths): don't create per-type output dirs at root when base set
create_paths() pre-created every per-type output folder via fix_path(), which resolves relative values against data_path (the repo root). With a base images/grids folder configured, those bare dirs are never written to (generation uses the base-joined path), so they accumulate as empty stray folders at the repo root on every launch. Guard the bare creations behind an unset base; the resolved base+specific block already creates the real targets.
2026-05-31 04:49:05 +01:00
CalamitousFelicitousness f8bd53a96b fix(preview): keep taesd preview size constant across decode layers
taesd_layers < 3 drops spatial upsample blocks in the TAESD/TAEHV
decoders, shrinking preview output 2x/4x. Both UIs size the live preview
from the image's intrinsic pixel dimensions (modern via object-fit:
scale-down, standard via max(naturalWidth, 512px)), so lower layer counts
rendered the preview physically small.

Rescale the decoded preview spatially by 2^(3-layers) in
sd_vae_taesd.decode. Gated to TAESD and TAEHV, the only decoders that
honor taesd_layers; TAEM1 and Hybrid VAEs decode at full size and are left
untouched. Rank-agnostic so it covers both image (CHW) and video (TCHW)
previews, including single-frame video models used for txt2img.
2026-05-31 04:43:10 +01:00
CalamitousFelicitousness 77913c7c0a docs: cleanup
- generic.load_transformer: shorter dispatch description, no internal taxonomy
- native_transformer.load: trim kwargs forwarding wording
- sd_unet revert: one-line comment
- test: shorten kwargs-forwarding docstrings
2026-05-31 02:04:56 +01:00
CalamitousFelicitousness 23c06c39d6 refactor(sd_unet): route transformer override through reload_model_weights
The custom-transformer apply (DiT branch) and the revert-to-default path now call reload_model_weights(force=True) instead of load_diffuser, so both go through the same managed reload: unload-before-rebuild for a lower VRAM peak and consistent job/checkpoint bookkeeping.

Gate the cross-arch unet reset on an actual checkpoint change so a same-checkpoint reload skips the pipeline-class comparison, which could false-positive and clear the override when the model was left in an img2img/inpaint variant after an interrupted generation.
2026-05-31 00:24:33 +01:00
CalamitousFelicitousness 25fa8e0f15 refactor(ui): shorten unet-sync handlers, align load logs
- ui_settings: rename to sync_checkpoint_unet / sync_checkpoint_unet_forced
- sd_models: cross-arch unet reset log uses key=value house style
- generic: native transformer dispatch logs loader=native
2026-05-31 00:24:33 +01:00
CalamitousFelicitousness 7b9c5d5d8c fix(sd_models): hide misleading state_dict progress bar for safetensors
safetensors.torch.load_file opens the file by path internally, so the progress.open wrapper around it never advanced from 0/N - it just left a stuck '0.0/18.2 GB' bar on screen for the duration of the load. Skip the wrapper on that path; .ckpt and stream_load paths still get the working bar.
2026-05-31 00:24:33 +01:00
CalamitousFelicitousness 09c6229b1c fix(ui): refresh UNET dropdown after cross-arch model swap
When reload_model_weights resets shared.opts.sd_unet to Default on a cross-arch swap, the backend value changed but the dropdown component kept showing the previous selection because sd_unet was not in the change_checkpoint button's outputs.

Add the sd_unet component to the outputs and return its post-reload value via gr.update.
2026-05-31 00:24:33 +01:00
CalamitousFelicitousness bab6c253f4 feat(sd_unet): reset UNET override on cross-arch base model swap
A custom UNET selected via the UNET dropdown carried over silently when the user swapped to a base model of a different arch, then crashed inside the per-arch loader because shared.opts.sd_unet was still pointing at the previous arch's file.

reload_model_weights now runs sd_detect.detect_pipeline on the new checkpoint before unloading the old model, compares the detected pipeline class against the loaded model's class, and resets shared.opts.sd_unet to Default when they differ.
2026-05-31 00:24:33 +01:00
CalamitousFelicitousness 9326804d69 fix(sd_unet): reload model when reverting UNET dropdown to Default
load_unet returned early when sd_unet was set to 'Default'/'None',
leaving any previously-loaded custom UNET in memory. The model stayed
on the override and the dropdown looked stuck.

Now detects the transition from a custom selection to Default and
triggers sd_models.load_diffuser() to reload via the canonical
from_pretrained path.
2026-05-31 00:24:33 +01:00
CalamitousFelicitousness 55db15c213 docs: cleanup 2026-05-31 00:24:33 +01:00
CalamitousFelicitousness 5b321d2071 refactor(lora): update importers for native_adapter rename
5 pipeline files + 2 test files. Mechanical substitution. 141/141
adapter tests pass.
2026-05-31 00:24:33 +01:00
CalamitousFelicitousness 7cd6b6be79 refactor(lora): rename native_loader to native_adapter
Frees the name for pipelines/native_transformer. Module covers the full
LyCORIS adapter family (LoRA/LoKR/LoHA/OFT/IA3/GLoRA/Norm/Full), not
just LoRA.
2026-05-31 00:24:33 +01:00
Vladimir Mandic a0531c70fd add new attention dispatcher
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-29 21:10:56 +02:00
Vladimir Mandic d2d9f7caea captioning improvements and cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-29 21:10:56 +02:00
Vladimir Mandic 06545baa00 force reinstall transformers/diffusers
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-29 07:11:46 +02:00
Vladimir Mandic 5a4a1ff2a1 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-28 12:11:01 +02:00
Vladimir Mandic 89e728c9d5 refactor uv support
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-28 11:54:08 +02:00
Vladimir Mandic 0e99be5de2 lint fix
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-27 16:31:59 +02:00
Vladimir Mandic 113d4efae8 add lens img2img and inpaint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-25 10:40:20 +02:00
Vladimir Mandic d5650184fc add str to sdnqconfig
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-25 10:40:20 +02:00
CalamitousFelicitousness 566b6629bd fix(styles): key style dict by prefixed name to prevent nested collisions
Styles in nested subfolders that shared a base JSON name were being
overwritten because load_style keyed self.styles by the raw style["name"]
while the Style object stored the prefixed name. The extra networks page
iterates dict keys, so only one card per name surfaced.

Key the dict by the same prefixed name, and warn when a true duplicate
(same prefix and same name) is still detected.
2026-05-25 02:05:37 +01:00
Vladimir Mandic 952f998d27 Merge pull request #4867 from awsr/moduletype
Use ModuleType directly
2026-05-24 08:29:31 +02:00
CalamitousFelicitousness 9587972831 fix(lora): natural-filename lookup on windows and in subfolders
NetworkOnDisk.fullname stripped only "/" from the post-lora_dir slice,
leaving a leading "\" on Windows. Every prompt typing the file's
natural dot-form name missed both registered aliases. On Linux,
dot-form lookup already missed when the file lived in any subfolder
because only the subfolder-prefixed form was registered.

- network.py: lstrip both separators and normalize backslashes to
  forward slashes so fullname has one canonical shape per OS.
- lora_load.py: register a bare-basename-with-dots alias so typing
  <lora:my.lora:1> resolves regardless of subfolder placement.
  setdefault preserves explicit primary registrations on cross-subfolder
  basename collisions.

Existing prompts using the legacy dots-to-underscores form continue
to resolve via entry.name unchanged.
2026-05-24 02:46:48 +01:00