Commit Graph

13472 Commits

Author SHA1 Message Date
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 1061eaf815 Merge pull request #4871 from resonantsky/dev
Added Z-Image-Turbo : Moody Real Mix to community models
2026-05-24 14:11:39 +02:00
resonantsky 6468c41bda Update MoodyRealMix community preview metadata 2026-05-24 14:05:06 +02:00
Vladimir Mandic 2af0934cad fix gallery layout in standardui
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-24 13:59:39 +02:00
resonantsky c36d37df0a Added Z-Image-Turbo : Moody Real Mix to community models 2026-05-24 13:59:39 +02:00
resonantsky f5ba21a2ef Added Z-Image-Turbo : Moody Real Mix to community models 2026-05-24 13:44:57 +02:00
Vladimir Mandic ded26d1fbc lens fixes
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-24 08:45:44 +02:00
Vladimir Mandic 952f998d27 Merge pull request #4867 from awsr/moduletype
Use ModuleType directly
2026-05-24 08:29:31 +02:00
Vladimir Mandic 16f43f0823 Merge pull request #4869 from vladmandic/fix/lora-name-lookup
fix(lora): natural-filename lookup on windows and in subfolders
2026-05-24 08:29:20 +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
awsr 77d34e7604 Use ModuleType directly 2026-05-23 04:47:31 -07:00
Vladimir Mandic 751c237326 warn on wrong default guidance
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-23 10:18:40 +02:00
Vladimir Mandic 9fc858d75e add microsoft lens
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-23 09:49:42 +02:00
Vladimir Mandic 5f04d472ce additional exports
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-23 08:32:33 +02:00
Vladimir Mandic e50fc62ee7 fix networks click-select
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-23 07:36:55 +02:00
Vladimir Mandic 60e6c37e24 fix script params
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-22 18:28:22 +02:00
Disty0 1377495998 lint 2026-05-22 18:21:22 +03:00
Vladimir Mandic 082498e6bd prompt-enhance-v2 with steering
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-22 16:58:23 +02:00
Disty0 e484850e9e Cleanup SDNQ 2026-05-22 17:32:41 +03:00
Vladimir Mandic ad9c937e68 Merge pull request #4862 from vladmandic/fix/editable-dropdown-blur
fix(ui): debounce editable dropdowns in quicksettings
2026-05-22 06:12:38 +02:00
CalamitousFelicitousness 9457a8282e fix(ui): expose cardClicked on window for inline onclick handlers
modules/ui_extra_networks.py emits onclick="cardClicked(...)" on
every network card, but cardClicked was module-private in
ui/extraNetworks.ts and got tree-shaken out of the bundle. Attach
it to window like showCardDetails so card clicks resolve and the
<lora:...> insertion path works.
2026-05-22 01:53:41 +01:00
CalamitousFelicitousness 5a837224b9 Merge pull request #4863 from vladmandic/refactor/anima-native-loader
refactor(anima): migrate to generic native_loader
2026-05-22 01:24:04 +01:00
CalamitousFelicitousness 84683a1d84 refactor(anima): migrate to generic native_loader
Replaces anima_lora.py's bespoke try_load_lora / group_keys /
resolve_network_key with thin wrappers binding native_loader's generics
to anima's prefix tuples and resolve_targets, mirroring flux2 / zimage /
chroma / ernie. The hand-rolled apply_lora_alphas bake-with-balance
pass goes away; alpha / scale / dora_scale flow through NetworkWeights.w
to NetworkModule.calc_scale at apply time.

native_loader gains an optional network_prefix kwarg (str or
Callable[[prefix_used], str], default "lora_transformer_") used when
constructing network_key. Anima passes a callable picking
lora_transformer_ / lora_llm_adapter_ / lora_te_ per matched prefix.
Single-component siblings keep the default and are unchanged.

network.NetworkModule.apply_weight_decompose grows a dual-path DoRA
convention detector. The pre-fix implementation only handled per-input
dora_scale (DoRA paper / kohya, shape (1, in)), silently broadcasting
per-output LyCORIS / PEFT dora_scale (shape (out, 1)) into an incoherent
element-wise rescaling. Detection is structural: (out, 1, ...) routes
to per-output; everything else (including the square-weight 1D ambiguity)
defaults to per-input for legacy compat. Pre-existing bug surfaced by
the LoKR+DoRA LyCORIS files Anima now loads.

Behavior changes:

- LoHA via the generic try_load_loha (NetworkModuleHada); covers
  scenery-anima-base and any other LyCORIS .hada_w* export.
- Kohya lora_te_ prefix recognized. The legacy resolver only matched
  BFL text_encoders.qwen3_06b.transformer.model. and silently dropped
  lora_te_layers_N_* keys (41% of BlueArcStyle's bases were unloaded).
- LoKR+DoRA LyCORIS files now apply correctly; the per-output dora_scale
  is honored instead of silently scrambled.

Adds test/test-anima-native-adapters.py: 37 offline tests across all
five prefixes (LoRA + LoHA), every COSMOS_2_FLAT_RENAME entry, DoRA
threading, marker disambiguation, try_load_chain dispatch, calc_updown
sanity, and both DoRA conventions (per-input / per-output / 1D ambiguous).
Adapter mock mirrors AnimaLLMAdapter's real module tree.
2026-05-22 00:22:32 +01:00
Disty0 f91893d0df Fix bias dtype mismatch with pre-quants 2026-05-22 00:08:42 +03:00
Disty0 3e879ccb69 cleanup 2026-05-21 23:44:44 +03:00
Disty0 cfafbed868 don't duplicate modules_to_not_convert 2026-05-21 20:44:28 +03:00
Disty0 9adf20a47c fix asym quant with hadamard 2026-05-21 17:22:45 +03:00
Vladimir Mandic 7d91ee9611 enhance globals
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-21 12:02:01 +02:00
Vladimir Mandic b35f8fa831 ui fixes
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-21 09:23:10 +02:00
Vladimir Mandic 1e47ade7ee Merge pull request #4861 from vladmandic/refactor/native-loader
Refactor/native loader
2026-05-21 08:57:33 +02:00
CalamitousFelicitousness 9de161e65a fix(ui): debounce editable dropdowns in quicksettings
Editable dropdowns (sd_model_checkpoint, sd_text_encoder) fired a
.change event on every keystroke because Gradio's allow_custom_value
keyup handler sets the value to the typed text.

- Use .blur instead of .change for DropdownEditable in quicksettings
- Validate model keys in run_settings_single before committing
2026-05-21 03:58:41 +01:00
CalamitousFelicitousness 98ea64943f fix(modelloader): convert ModelCardData to dict before saving model_info.json 2026-05-21 03:11:05 +01:00
CalamitousFelicitousness 394d4e5b84 fix(ltx): patch connectors regression and group model dropdown
- monkey-patch LTX2ConnectorTransformer1d.forward to restore pre-#13564
  padding logic when the upstream torch.flip pattern is detected; fixes
  word-order scrambling in audio dialogue tracks
- reorganize LTX model entries into version-group separators (2.3 v1.1,
  2.3 v1.0, 2.0, 0.9.x) with base/distilled subgroups; separators are
  selectable no-ops handled in run_ltx
2026-05-21 03:01:51 +01:00
Vladimir Mandic 32d245898c update readme and wiki
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-20 20:28:28 +02:00
Vladimir Mandic 68d73a2aca update contributing
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-20 20:15:48 +02:00
Vladimir Mandic e03557462a update ai instructions
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-20 20:09:06 +02:00
Disty0 40bd5ca00d Make Triton MM block sizes configurable 2026-05-20 19:16:21 +03:00
Vladimir Mandic 4b2f38ab7f complete refactor javascript to typescript and reorg frontend files and folders
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-20 18:08:10 +02:00
Disty0 4341193b35 SDNQ trigger triton_mm autotune for every multiple of 64 instead of 1 2026-05-20 15:36:12 +03:00
Disty0 cad5ab19c8 SDNQ use torch.compile friendly hadamard cache 2026-05-19 22:18:58 +03:00
Vladimir Mandic 01a68baa47 update masking
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-19 11:56:20 +02:00
Vladimir Mandic a56d1d299e add wildcards to image metadata and note separate template from prompt field
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-19 09:45:20 +02:00
CalamitousFelicitousness 4c3f4db129 refactor(lora): collapse native dispatcher to a registry
Five if-blocks in lora_load.load_safetensors reduce to one lookup in
_NATIVE_DISPATCH, a string -> module-path map keyed by shared.sd_model_type.

Each entry's module exposes try_load(name, network_on_disk, lora_scale).
flux2 / zimage / chroma / ernie use the umbrella that binds native_loader's
generics via try_load_chain. Anima keeps its own try_load (aliased to
try_load_lora) since its multi-component routing doesn't fit the shared
suffix-table model.

New native archs land by adding one entry to the dict and shipping a
try_load.
2026-05-18 23:38:37 +01:00
CalamitousFelicitousness 6937ea803f refactor(ernie): migrate to generic native_loader
Replaces ernie's four family loaders with thin wrappers binding
native_loader's generics to ernie's prefix tuples and resolve_targets.

ErnieImageAttention has fully split to_q / to_k / to_v with no fused QKV
and ErnieImageFeedForward has three separate Linear modules, so
resolve_targets is a straight passthrough across every recognized prefix.

BARE_DIFFUSERS_PREFIXES covers layers., adaLN_modulation., final_norm.,
final_linear. for bare-diffusers exports (e.g. via save_lora_adapter).

parse_key returns (prefix_used, base, suffix) instead of the old
(network_key, suffix); parse test updated.
2026-05-18 23:34:41 +01:00
CalamitousFelicitousness e45c23c031 refactor(chroma): migrate to generic native_loader
Replaces chroma's four family loaders with thin wrappers binding
native_loader's generics to chroma's prefix tuples and resolve_targets.

resolve_targets folds the Flux-to-diffusers rename table and the two
fused-weight splits into one path-resolution step:

- img_attn.qkv / txt_attn.qkv: ChunkSpec(idx, total=3) for equal Q/K/V
- single_blocks.linear1: ChunkSpec(start, end) for the unequal
  Q/K/V/proj_mlp partition

QKV_DIMS and LINEAR1_DIMS stay as module-level constants (tests patch
them for the scaled-down mock).

Behavior changes:

- LoKR on equal-chunk QKV now dispatches to NetworkModuleLokrChunk
  instead of NetworkModuleLokrSliceChunk (the slice variant was used
  pre-migration for both forms since chroma had no equal-chunk path).
- LoHA on fused img_attn.qkv now binds via NetworkModuleHadaChunk
  instead of being skipped; the shared HadaChunk added in the flux2 PR
  is general for equal-chunks dispatch.

parse_key returns (prefix_used, base, suffix) instead of the old
(flat_key, suffix); rename happens in resolve_targets. test_static_rename_table
replaced with test_resolve_targets_static_renames driving the same
remappings through the new interface.
2026-05-18 23:31:17 +01:00
CalamitousFelicitousness c3b7379fd3 refactor(zimage): migrate to generic native_loader
Replaces zimage's four family loaders with thin wrappers binding
native_loader's generics to z-image's prefix tuples and resolve_targets.

resolve_targets folds the legacy attention.qkv split and attention.out
alias rename into the path-resolution step. Fused qkv now emits three
ChunkSpec(idx, total=3) entries; attention.out / attention.out.0 /
attention.wo aliases collapse to attention.to_out.0.

BARE_DIFFUSERS_PREFIXES allows bare paths starting with layers. /
noise_refiner. / context_refiner. to pass through to the loader. This
matches real Z-Image LoRAs exported via
ZImageTransformer2DModel.save_lora_adapter().

LoHA on fused qkv now binds via NetworkModuleHadaChunk (added to shared
infra by the flux2 PR) instead of being skipped. Test renamed to
test_loha_legacy_fused_qkv_chunked.

parse_key returns (prefix_used, base, suffix) instead of the old
(network_key, suffix); parse test updated.
2026-05-18 23:20:03 +01:00
CalamitousFelicitousness c7e8e7a029 test(ernie): offline tests for native adapter loaders
Covers ernie's four-family surface (LoRA, LoKR, LoHA, OFT).

ErnieImageAttention has fully split to_q / to_k / to_v with no fused QKV,
and ErnieImageFeedForward has three separate Linear modules. The loader
has no chunking, renames, or fused-target dispatch.

Mock matches diffusers.ErnieImageTransformer2DModel
(ErnieImageSharedAdaLNBlock with self_attention + mlp + RMSNorms, plus
module-level adaLN_modulation Sequential and final_linear).

Formats exercised:

- BFL / AI-toolkit
- kohya
- BFL LoKR
2026-05-18 23:19:46 +01:00
CalamitousFelicitousness 1f309fe836 test(chroma): offline tests for native adapter loaders
Covers chroma's four-family surface plus the Flux-to-diffusers rename
and the unique single-block linear1 unequal-chunk slicing.

Mock transformer matches diffusers.ChromaTransformer2DModel
(transformer_blocks with FluxAttention(added_kv_proj_dim), single
transformer_blocks with pre-only attn + proj_mlp + proj_out, plus
distilled_guidance_layer).

Formats exercised:

- BFL / AI-toolkit
- kohya
- PEFT
- LyCORIS oft_diag

install_mock_pipe patches chroma_lora.QKV_DIMS and LINEAR1_DIMS to the
test scale (HIDDEN=96, MLP_HIDDEN=384); the module otherwise hardcodes
Chroma1-HD's 3072 / 12288.
2026-05-18 23:19:35 +01:00