Commit Graph

13234 Commits

Author SHA1 Message Date
Alexander Eichhorn
3e862ced25 fix typegen wrong 2025-12-09 07:46:12 +01:00
Alexander Eichhorn
ba2475c3f0 fix(z-image): improve device/dtype compatibility and error handling
Add robust device capability detection for bfloat16, replacing hardcoded
dtype with runtime checks that fallback to float16/float32 on unsupported
hardware. This prevents runtime failures on GPUs and CPUs without bfloat16.

Key changes:
- Add TorchDevice.choose_bfloat16_safe_dtype() helper for safe dtype selection
- Fix LoRA device mismatch in layer_patcher.py (add device= to .to() call)
- Replace all assert statements with descriptive exceptions (TypeError/ValueError)
- Add hidden_states bounds check and apply_chat_template fallback in text encoder
- Add GGUF QKV tensor validation (divisible by 3 check)
- Fix CPU noise generation to use float32 for compatibility
- Remove verbose debug logging from LoRA conversion utils
2025-12-09 07:37:06 +01:00
Alexander Eichhorn
841372944f feat(z-image): add metadata recall for VAE and Qwen3 encoder
Add support for saving and recalling Z-Image component models (VAE and
Qwen3 Encoder) in image metadata.

Backend:
- Add qwen3_encoder field to CoreMetadataInvocation (version 2.1.0)

Frontend:
- Add vae and qwen3_encoder to Z-Image graph metadata
- Add Qwen3EncoderModel metadata handler for recall
- Add ZImageVAEModel metadata handler (uses zImageVaeModelSelected
  instead of vaeSelected to set Z-Image-specific VAE state)
- Add qwen3Encoder translation key

This enables "Recall Parameters" / "Remix Image" to restore the VAE
and Qwen3 Encoder settings used for Z-Image generations.
2025-12-09 07:12:36 +01:00
Alexander Eichhorn
e9d52734d1 feat(z-image): add single-file checkpoint support for Z-Image models
Add support for loading Z-Image transformer and Qwen3 encoder models
from single-file safetensors format (in addition to existing diffusers
directory format).

Changes:
- Add Main_Checkpoint_ZImage_Config and Main_GGUF_ZImage_Config for
  single-file Z-Image transformer models
- Add Qwen3Encoder_Checkpoint_Config for single-file Qwen3 text encoder
- Add ZImageCheckpointModel and ZImageGGUFCheckpointModel loaders with
  automatic key conversion from original to diffusers format
- Add Qwen3EncoderCheckpointLoader using Qwen3ForCausalLM with fast
  loading via init_empty_weights and proper weight tying for lm_head
- Update z_image_denoise to accept Checkpoint format models
2025-12-09 06:32:51 +01:00
Alexander Eichhorn
2e0cd4d68c Patch from @lstein for the update of diffusers 2025-12-06 03:12:50 +01:00
Alexander Eichhorn
b28d58b8ce Merge branch 'feat/z-image-turbo-support' of https://github.com/Pfannkuchensack/InvokeAI into feat/z-image-turbo-support 2025-12-05 01:12:34 +01:00
Alexander Eichhorn
4a1710b795 fix for the typegen-checks 2025-12-05 01:12:19 +01:00
Alexander Eichhorn
9f6d04c690
Merge branch 'main' into feat/z-image-turbo-support 2025-12-05 00:45:02 +01:00
Alexander Eichhorn
66729ea9eb Fix windows path again again again... 2025-12-03 03:28:43 +01:00
Alexander Eichhorn
280202908a feat: Add GGUF quantized Z-Image support and improve VAE/encoder flexibility
Add comprehensive support for GGUF quantized Z-Image models and improve component flexibility:

Backend:
- New Main_GGUF_ZImage_Config for GGUF quantized Z-Image transformers
- Z-Image key detection (_has_z_image_keys) to identify S3-DiT models
- GGUF quantization detection and sidecar LoRA patching for quantized models
- Qwen3Encoder_Qwen3Encoder_Config for standalone Qwen3 encoder models

Model Loader:
- Split Z-Image model
2025-12-02 20:31:11 +01:00
Alexander Eichhorn
2b062b21cd fix: Improve Flux AI Toolkit LoRA detection to prevent Z-Image misidentification
Move Flux layer structure check before metadata check to prevent misidentifying Z-Image LoRAs (which use `diffusion_model.layers.X`) as Flux AI Toolkit format. Flux models use `double_blocks` and `single_blocks` patterns which are now checked first regardless of metadata presence.
2025-12-02 15:50:01 +01:00
Alexander Eichhorn
6f9f8e57ac
Feature(UI): bulk remove models loras (#8659)
* feat: Add bulk delete functionality for models, LoRAs, and embeddings

Implements a comprehensive bulk deletion feature for the model manager that allows users to select and delete multiple models, LoRAs, and embeddings at once.

Key changes:

Frontend:
- Add multi-selection state management to modelManagerV2 slice
- Update ModelListItem to support Ctrl/Cmd+Click multi-selection with checkboxes
- Create ModelListHeader component showing selection count and bulk actions
- Create BulkDeleteModelsModal for confirming bulk deletions
- Integrate bulk delete UI into ModelList with proper error handling
- Add API mutation for bulk delete operations

Backend:
- Add POST /api/v2/models/i/bulk_delete endpoint
- Implement BulkDeleteModelsRequest and BulkDeleteModelsResponse schemas
- Handle partial failures with detailed error reporting
- Return lists of successfully deleted and failed models

This feature significantly improves user experience when managing large model libraries, especially when restructuring model storage locations.

Fixes issue where users had to delete models individually after moving model files to new storage locations.

* fix: prevent model list header from scrolling with content

* fix: improve error handling in bulk model deletion

- Added proper error serialization using serialize-error for better error logging
- Explicitly defined BulkDeleteModelsResponse type instead of relying on generated schema reference

* refactor: improve code organization in ModelList components

- Reordered imports to follow conventional grouping (external, internal, then third-party utilities)
- Added type assertion for error serialization to satisfy TypeScript
- Extracted inline event handler into named callback function for better readability

* refactor: consolidate Button component props to single line

* feat(ui): enhance model manager bulk selection with select-all and actions menu

- Added select-all checkbox in navigation header with indeterminate state support
- Replaced single delete button with actions dropdown menu for future extensibility
- Made checkboxes always visible instead of conditionally showing on selection
- Moved model filtering logic to ModelListNavigation for select-all functionality
- Improved UX by showing selection state for filtered models only

* fix the wrong path seperater from my windows system

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-01 20:09:27 -05:00
Alexander Eichhorn
eaf4742799 Fix windows path again again 2025-12-01 22:28:39 +01:00
Alexander Eichhorn
f05ea28cbd feat: Add Z-Image LoRA support
Add comprehensive LoRA support for Z-Image models including:

Backend:
- New Z-Image LoRA config classes (LoRA_LyCORIS_ZImage_Config, LoRA_Diffusers_ZImage_Config)
- Z-Image LoRA conversion utilities with key mapping for transformer and Qwen3 encoder
- LoRA prefix constants (Z_IMAGE_LORA_TRANSFORMER_PREFIX, Z_IMAGE_LORA_QWEN3_PREFIX)
- LoRA detection logic to distinguish Z-Image from Flux models
- Layer patcher improvements for proper dtype conversion and parameter
2025-12-01 22:23:30 +01:00
Alexander Eichhorn
13ac16e2c0 fix windows path again. 2025-12-01 00:30:53 +01:00
Alexander Eichhorn
eb3f1c9a61 feat: Add Z-Image-Turbo model support
Add comprehensive support for Z-Image-Turbo (S3-DiT) models including:

Backend:
- New BaseModelType.ZImage in taxonomy
- Z-Image model config classes (ZImageTransformerConfig, Qwen3TextEncoderConfig)
- Model loader for Z-Image transformer and Qwen3 text encoder
- Z-Image conditioning data structures
- Step callback support for Z-Image with FLUX latent RGB factors

Invocations:
- z_image_model_loader: Load Z-Image transformer and Qwen3 encoder
- z_image_text_encoder: Encode prompts using Qwen3 with chat template
- z_image_denoise: Flow matching denoising with time-shifted sigmas
- z_image_image_to_latents: Encode images to 16-channel latents
- z_image_latents_to_image: Decode latents using FLUX VAE

Frontend:
- Z-Image graph builder for text-to-image generation
- Model picker and validation updates for z-image base type
- CFG scale now allows 0 (required for Z-Image-Turbo)
- Clip skip disabled for Z-Image (uses Qwen3, not CLIP)
- Optimal dimension settings for Z-Image (1024x1024)

Technical details:
- Uses Qwen3 text encoder (not CLIP/T5)
- 16 latent channels with FLUX-compatible VAE
- Flow matching scheduler with dynamic time shift
- 8 inference steps recommended for Turbo variant
- bfloat16 inference dtype
2025-12-01 00:22:32 +01:00
Kent Keirsey
c6a9847bbd
feat(ui): Color Picker V2 (#8585)
* pinned colorpicker

* hex options

* remove unused consts

---------

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2025-11-16 09:49:55 -05:00
Alexander Eichhorn
a2e109b3c2
feat(ui): improve hotkey customization UX with interactive controls and validation (#8649)
* feat: remove the ModelFooter in the ModelView and add the Delete Model Button from the Footer into the View

* forget to run pnpm fix

* chore(ui): reorder the model view buttons

* Initial plan

* Add customizable hotkeys infrastructure with UI

Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>

* Fix ESLint issues in HotkeyEditor component

Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>

* Fix knip unused export warning

Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>

* Add tests for hotkeys slice

Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>

* Fix tests to actually call reducer and add documentation

Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>

* docs: add comprehensive hotkeys system documentation

- Created new HOTKEYS.md technical documentation for developers explaining architecture, data flow, and implementation details
- Added user-facing hotkeys.md guide with features overview and usage instructions
- Removed old CUSTOMIZABLE_HOTKEYS.md in favor of new split documentation
- Expanded documentation with detailed sections on:
  - State management and persistence
  - Component architecture and responsibilities
  - Developer integration

* Behavior changed to hotkey press instead of input + checking for allready used hotkeys

---------

Co-authored-by: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>
Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2025-11-16 14:35:37 +00:00
dunkeroni
5642099a40
Feat: SDXL Color Compensation (#8637)
* feat(nodes/UI): add SDXL color compensation option

* adjust value

* Better warnings on wrong VAE base model

* Restrict XL compensation to XL models

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>

* fix: BaseModelType missing import

* (chore): appease the ruff

---------

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2025-11-16 14:32:12 +00:00
gogurtenjoyer
382d85ee23
Fix memory issues when installing models on Windows (#8652)
* Wrap GGUF loader for context managed close()

Wrap gguf.GGUFReader and then use a context manager to load memory-mapped GGUF files, so that they will automatically close properly when no longer needed. Should prevent the 'file in use in another process' errors on Windows.

* Additional check for cached state_dict

Additional check for cached state_dict as path is now optional - should solve model manager 'missing' this and the resultant memory errors.

* Appease ruff

* Further ruff appeasement

* ruff

* loaders.py fix for linux

No longer attempting to delete internal object.

* loaders.py - one more _mmap ref removed

---------

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2025-11-16 09:25:52 -05:00
Jonathan
abcc987f6f
Rework graph.py (#8642)
* Rework graph, add documentation

* Minor fixes to README.md

* Updated schema

* Fixed test to match behavior - all nodes executed, parents before children

* Update invokeai/app/services/shared/graph.py

Cleaned up code

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>

* Change silent corrections to enforcing invariants

---------

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2025-11-16 09:10:47 -05:00
Weblate (bot)
0113931956
ui: translations update from weblate (#8599)
* translationBot(ui): update translation (Italian)

Currently translated at 98.4% (2099 of 2132 strings)

translationBot(ui): update translation (Italian)

Currently translated at 98.4% (2130 of 2163 strings)

translationBot(ui): update translation (Italian)

Currently translated at 98.4% (2130 of 2163 strings)

Co-authored-by: Riccardo Giovanetti <riccardo.giovanetti@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/
Translation: InvokeAI/Web UI

* translationBot(ui): update translation (Japanese)

Currently translated at 99.6% (2155 of 2163 strings)

Co-authored-by: RyoKoba <kobayashi_ryo@cyberagent.co.jp>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/ja/
Translation: InvokeAI/Web UI

* translationBot(ui): update translation files

Updated by "Cleanup translation files" hook in Weblate.

translationBot(ui): update translation files

Updated by "Cleanup translation files" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/
Translation: InvokeAI/Web UI

* translationBot(ui): update translation (Italian)

Currently translated at 98.4% (2103 of 2136 strings)

Co-authored-by: Riccardo Giovanetti <riccardo.giovanetti@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/
Translation: InvokeAI/Web UI

---------

Co-authored-by: Riccardo Giovanetti <riccardo.giovanetti@gmail.com>
Co-authored-by: RyoKoba <kobayashi_ryo@cyberagent.co.jp>
2025-11-04 02:29:05 +00:00
DustyShoe
8d6e00533e
Fix to enable loading fp16 repo variant ControlNets (#8643)
* Fix ControlNet repo variant detection for fp16 weights

* Remove ControlNet diffusers fp16 regression test

* Update invokeai/backend/model_manager/configs/controlnet.py

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>

* style: ruff format controlnet.py

---------

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2025-11-03 21:23:35 -05:00
blessedcoolant
ad0b09c738 chore(ui): reorder the model view buttons 2025-10-28 00:16:20 +05:30
Alexander Eichhorn
737cf795e8 forget to run pnpm fix 2025-10-28 00:16:20 +05:30
Alexander Eichhorn
6192ff5abb feat: remove the ModelFooter in the ModelView and add the Delete Model Button from the Footer into the View 2025-10-28 00:16:20 +05:30
Lincoln Stein
2fb4c92310 fix(mm): directory path leakage on scan folder error 2025-10-27 08:54:57 -04:00
psychedelicious
3fdceba5fc chore: bump version to v6.9.0 2025-10-17 12:13:01 +11:00
psychedelicious
ae4bcc08f2 chore(ui): point ui lib dep at gh repo 2025-10-17 07:22:39 +11:00
psychedelicious
e1d88f93ca fix(ui): generator nodes
Closes #8617
2025-10-16 10:37:14 +11:00
psychedelicious
4ad2574835 feat(ui): add button to reidentify model to mm 2025-10-16 10:33:02 +11:00
psychedelicious
0e3d4beb48 chore(ui): typegen 2025-10-16 10:33:02 +11:00
psychedelicious
dcfd4ea756 feat(mm): reidentify models
Add route and model record service method to reidentify a model. This
re-probes the model files and replaces the model's config with the new
one if it does not error.
2025-10-16 10:33:02 +11:00
psychedelicious
093f8d6720 fix(mm): ignore files in hidden directories when identifying models 2025-10-16 10:33:02 +11:00
psychedelicious
22fdfab764 chore: bump version to v6.9.0rc3 2025-10-16 08:08:44 +11:00
psychedelicious
7a0b157fb8 feat(mm): more exports in invocation api 2025-10-16 08:08:44 +11:00
psychedelicious
563da9ee8e feat(mm): write warning README file to models dir 2025-10-16 08:08:44 +11:00
psychedelicious
c8d9cdc22e docs(mm): add readme for updating or adding new model support 2025-10-16 08:08:44 +11:00
psychedelicious
e9c2411da9 chore: bump version to v6.9.0rc2 2025-10-16 08:08:44 +11:00
psychedelicious
90989291ed fix(ui): wait for nav api to be ready before loading main app component 2025-10-16 08:08:44 +11:00
psychedelicious
d04fc343f0 feat(ui): add flag for connected status 2025-10-16 08:08:44 +11:00
psychedelicious
437594915a feat(mm): add model taxonomy and other classes to public API exports 2025-10-16 08:08:44 +11:00
psychedelicious
875aba8979 tidy(mm): remove unused class 2025-10-16 08:08:44 +11:00
psychedelicious
61d13f20ea chore: bump version to v6.9.0rc1 2025-10-16 08:08:44 +11:00
psychedelicious
3b0dd5768b chore(ui): update whatsnew 2025-10-16 08:08:44 +11:00
psychedelicious
d9888912e8 chore(ui): fix schema 2025-10-15 10:46:16 +11:00
psychedelicious
7cfaca804a chore: ruff 2025-10-15 10:46:16 +11:00
psychedelicious
f37f817fd1 fix(ui): move logging setup to react code 2025-10-15 10:46:16 +11:00
psychedelicious
85e5b40627 docs(ui): add canvas overview and design doc 2025-10-15 10:46:16 +11:00
psychedelicious
e93cda8b2b docs(ui): more documentation 2025-10-15 10:46:16 +11:00