- Introduced a new setting for preferred native models, allowing users to select from available .safetensors text encoders.
- Implemented API endpoint to fetch native model options dynamically.
- Updated the PromptGenerator class to handle native text encoders, including validation and prompt conversion logic.
- Enhanced user interface elements to accommodate new settings and options for native models.
- Refactored existing code to improve clarity and maintainability, including renaming variables and functions for better context.
Shared by the Prompt Manager nodes and the Multi LoRA nodes; the Multi LoRA
nodes drop their identical copy of the stack normalizer. No behaviour
change: Prompt Manager runs and saves compare equal to the previous
version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- nodes/prompt_library_routes.py: get-prompts, category and prompt create,
rename, delete, thumbnail, NSFW, import and the library file routes, each
answered at /prompt-manager/... and /prompt-manager-advanced/..., with one
error handler. Basic and Advanced had a copy each; the Basic node keeps
only its save route, Advanced its save and LoRA routes.
- Prompt rename finds the prompt whatever its case on both prefixes.
- py/prompt_metadata.py: the prompt a node output, recorded in the workflow
and API prompt save nodes embed; Basic now drops its llm_input link there
too, as Advanced does with its prompt link.
- Removed routes nothing calls: save-category-base-prompt,
save-category-prompt-prefix, get-prompt-data, list-checkpoints,
resolve-loras, and log-thumbnail with the browser call that only printed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- py/prompt_store.py: the one place prompt_manager_data.json is loaded,
seeded, sorted and saved, and the hidden category keys; Basic, Advanced,
Library Manager and startup use it instead of two class copies.
- Each load parsed the file about four times (the daily backup check ran on
every load); now once. The backup stays daily, at startup.
- An unreadable library with no readable backup loads empty instead of
being overwritten with the default prompts.
- First run no longer reports the file as missing or corrupt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Introduced `_default_subject_kind` and `_legacy_subject_kind_for_name` functions to determine the kind of subject based on type.
- Added `_normalize_subject_kind` function to normalize subject kind values.
- Updated `_normalize_type_data` and `_serialize_type_data` to include subject kind in the type data structure.
- Enhanced `_flatten_canonical_library` to handle subject kind when flattening library data.
- Modified `_ensure_type` to set subject kind based on provided subject type and name.
- Updated type validation in `_looks_like_single_type_payload` to include subject kind.
- Adjusted `compose_save_type_settings` to properly handle subject kind during type settings saving.
- Updated the PromptComposerStore to convert legacy v1 composer libraries to canonical v2 on first load.
- Removed legacy type order presets and adjusted prompt loading methods to utilize canonical v2 data.
- Introduced new methods for saving type files and resolving requested type files.
- Enhanced the normalization process for category and prompt data during migration.
- Improved error handling and logging for loading type files.
- Updated the image_to_base64_thumbnail function to increase JPEG quality from 75 to 85.
- Introduced a new prompt for generating bulk snippets focused on a single subject category, with specific guidelines for format and content.
- Enhanced the prompt saving functionality to handle cases where prompts may be renamed or moved between categories, ensuring no conflicts arise with existing prompts.
- Implemented case-insensitive checks for existing prompts to prevent duplication and maintain consistency across categories.
- Added `_safe_abspath` function to safely resolve file paths.
- Introduced `_count_prompt_totals` to count categories and prompts in the data.
- Implemented `_normalize_export_path` to ensure export paths are valid and have a .json extension.
- Created new endpoint `/prompt-manager/compose/replace-prompts` for replacing prompts with imported data.
- Added `/prompt-manager/compose/export-prompts-file` endpoint to export prompts to a specified file.
- Implemented `/prompt-manager/compose/load-prompts-file` endpoint to load prompts from a JSON file.
- Enhanced error handling and response messages for better user feedback.
- Introduced new file `prompt_store_adapters.js` to manage prompt-related endpoints and sources.
- Added constants for various prompt endpoints and sources.
- Implemented utility functions to handle prompt entry visibility, category retrieval, and request body construction for saving prompts based on source and endpoint.
- Added new prompt types: "Characteristic" and "Expression" to the prompt type choices.
- Introduced dynamic width adjustment for the prompt browser edit panel based on user input.
- Enhanced the clearPrompt function to optionally skip confirmation for discarding changes.
- Implemented functions to manage selected part indices in the prompt composer, allowing for better selection handling.
- Added merging and splitting functionality for prompt parts in the composer, improving user experience.
- Updated the prompt selection process to build parts from browser selections more efficiently.
- Modified the forwardWheelToCanvas function to capture events, ensuring better interaction with the canvas.
- Extended the prompt composer store to save additional metadata for prompts, including a new prompt type field.
- Introduced a new generation mode toggle in the Prompt Composer UI to switch between Image and Video LoRAs.
- Updated the prompt composition logic to handle separate Lora settings for image and video modes.
- Enhanced the Lora resolution functions to support relative path matching and improved error handling.
- Modified the prompt saving logic to accommodate new Lora fields for image and video strengths.
- Added functions to merge and manage Lora stacks more effectively.
- Implemented fetching of thumbnail results from history for improved user experience.
- Introduced output format selection (text or JSON) and compose position (before or after) in the prompt composer UI.
- Updated the prompt composer logic to handle new properties and ensure proper serialization of prompts.
- Enhanced the UI with toggle switches for output format and compose position.
- Modified the backend to support new properties in the prompt composition process.
- Improved handling of LoRA and RefMod assets in the prompt composition.
- Updated version number in pyproject.toml to 2.7.2.
- Introduced a new module `system_prompt_converter.py` for converting legacy system prompt formats to a new category-based structure.
- The converter supports in-place JSON file conversion with optional backup creation.
- Ensured that all system prompt categories are present in the converted data.
get_mmproj_path()'s heuristic search used os.listdir(models_dir), so mmproj
files placed in a model's own subfolder were never found. It also required
>= 4 shared non-quant keywords between model and mmproj filenames, which
fails for generically-named files like 'mmproj-BF16.gguf' that carry no
identifying keywords at all.
Add a same-folder fallback: if the model's directory contains exactly one
mmproj file, use it without requiring any naming convention. Keep the
keyword heuristic as a fallback for mmproj files that live elsewhere, and
make that search recurse into subfolders too.
get_local_models() used a non-recursive glob.glob(models_dir/*.gguf), so
.gguf files placed in subfolders of a configured models directory (e.g.
~/models/Gemma-4-31B-it/gemma-4-31B-it-qat-UD-Q4_K_XL.gguf) were never
listed as available models.
Walk the directory tree with os.walk instead and return each match as a
path relative to its models_dir. This matches the relative-path
convention ComfyUI's own folder_paths.recursive_search uses, so
is_model_local() and get_model_path() (which already join models_dir
with the returned name) work unchanged for subfolder entries.
Add optional gpu_device input to Prompt Generator Options node, allowing users
to specify which GPU loads the LLM weights via llama.cpp's --main-gpu flag.
Use case: with two GPUs, load your diffusion model on cuda:0 and the LLM
on cuda:1 by setting gpu_device to "1".
Changes:
- py/model_manager.py: Add llama_gpu_device preference (global default)
- nodes/prompt_generator_options.py: Add gpu_device optional input string field
- nodes/prompt_generator.py: Pass --main-gpu flag when gpu_device is specified,
track device in restart condition so server reloads when GPU selection changes
- Removed the ExpressionSelector class and its associated methods from expression_selector.py, consolidating expression handling into a new test file.
- Updated prompt_composer.py to introduce new prompt type handling, including a new function to resolve prompt types.
- Modified prompt_composer_manager.py to accommodate changes in hidden category entry keys.
- Adjusted prompt_composer_store.py to replace legacy prompt prefix handling with prompt type management.
- Added a new JavaScript file (prompt_browser_edit.js) for editing prompt categories, including UI elements for prompt type and base prompt settings.
- Introduced a new test file (expression_selector.py) to ensure the functionality of the expression selection process.
- Renamed `PromptMixerStore` to `PromptComposerStore` in `prompt_composer_store.py` for consistency.
- Updated method names and comments to reflect the new naming convention.
- Added new JavaScript files: `prompt_composer_common.js` and `prompt_composer_manager.js` to handle prompt composer functionality.
- Implemented functions for loading, saving, deleting, and managing prompts in the composer.
- Enhanced UI components for prompt selection and management, including buttons for saving, creating, and deleting prompts.
- Integrated thumbnail preview functionality for prompts.
- Added JSON import/export capabilities for prompt data.
- Added a new PromptComposer node to compose prompt fragments from multiple selectable parts.
- Each part can store category, selected prompt names (multi-select), and strength.
- Introduced functions to normalize strength, format fragments, and resolve prompt prefixes.
- Enhanced prompt mixing functionality by allowing dynamic prompt selection based on user-defined parts.
- Added API endpoints for saving base prompts and prompt prefixes for categories.
- Updated UI components to support the new prompt composer features, including thumbnail zoom and context menus.
- Refactored existing code to improve handling of hidden category entries and prompt selection logic.
- Updated `prompt_mixer_manager.js` to handle both PromptMixerManager and PromptComposerManager.
- Changed export filename from `prompt_mixer_data.json` to `prompt_composer_data.json`.
- Modified `prompt_mixer_selector.js` to include a preview box in the mixer preview.
- Removed `prompt_mixer_manager.py` as it is no longer needed.
- Renamed `prompt_mixer_store.py` to `prompt_composer_store.py` and updated its functionality to support the new Prompt Composer structure.
- Added new `default_composer_prompts.json` for default prompts.
- Created `prompt_composer_manager.py` to manage Prompt Composer fragments.
- Updated server routes to handle Prompt Composer requests.
- Implemented a new JavaScript module for the Expression Selector UI, allowing users to select and preview expressions stored in the Prompt Manager.
- Created a corresponding Python node to handle expression selection and substitution in prompts, including gender adaptations for pronouns.
- Integrated the expression selection functionality into the existing prompt management system, ensuring compatibility with current workflows.
- Added UI components for expression selection and preview, enhancing user experience and interaction.
- Added support for multiple LoRA slots (C and D) in PromptManagerAdvanced and PromptManager.
- Implemented functions to normalize and combine multi-LORA inputs.
- Updated metadata handling to persist resolved prompts for both workflow and API.
- Enhanced recipe data building to include additional LoRA configurations.
- Refactored existing methods to accommodate new LoRA structures and ensure backward compatibility.
- Simplified model slot normalization by removing unnecessary parameters and checks.
- Updated the logic for determining primary and secondary model slots in the workflow builder.
- Changed placeholder strings from '(from checkpoint)' to '(Default)' across various modules for consistency.
- Removed the WAN-specific builder class and adjusted the multi-slot builder to handle model slots more effectively.
- Enhanced the extraction utilities to ensure proper handling of VAE and CLIP information.
Co-authored-by: Copilot <copilot@github.com>