Commit Graph
105 Commits
Author SHA1 Message Date
FranckyB dfc640b2af feat: Add support for native text encoders in Prompt Manager
- 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.
2026-11-25 00:40:16 -05:00
FranckyBandClaude Opus 5.5 de4cb93788 Move the LoRA stack and recipe helpers into py/lora_stacks.py
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>
2026-11-24 08:39:48 -05:00
FranckyBandClaude Opus 5.5 5a55a69cd1 Serve the prompt library routes once, under both prefixes
- 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>
2026-11-24 01:00:18 -05:00
FranckyBandClaude Opus 5.5 23cc2c63dc Load the prompt library once per read from one shared store
- 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>
2026-11-24 00:55:10 -05:00
FranckyB 3759813b39 feat: add customizable thumbnail generation steps and improve sampler defaults handling 2026-10-19 23:50:38 -04:00
FranckyB 603fbaaeee feat: enhance prompt management with preferred model settings and draft handling in the editor 2026-10-07 22:18:24 -04:00
FranckyB 72eeb7e303 Similar to Prompt Composer, added the option to export only specific categories from Prompt Manager 2026-09-28 14:25:08 -04:00
FranckyB dd07bb5aea feat: enhance prompt composer and manager with improved LoRA handling and source tracking 2026-09-27 17:06:28 -04:00
FranckyB 738ea302d9 Add subject kind normalization and handling in prompt composer store
- 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.
2026-09-27 00:45:04 -04:00
FranckyB 87f6bc523c refactor: remove unused prompt type constants and simplify subject type handling 2026-09-26 22:35:45 -04:00
FranckyB a27f9c41ef feat: enhance category resolution and selection handling in prompt composer 2026-09-26 21:51:50 -04:00
FranckyB f0102c96bf feat: add dialog for creating new prompt groups with category selection 2026-09-26 20:08:22 -04:00
FranckyB e70b66dbb0 Refactor Prompt Composer Store for v2 migration and enhance thumbnail quality
- 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.
2026-09-26 19:50:14 -04:00
FranckyB 64ebd5e192 Refactor code structure for improved readability and maintainability 2026-09-26 17:14:41 -04:00
FranckyB 401c003471 Refactor code structure for improved readability and maintainability 2026-09-26 13:27:02 -04:00
FranckyB 2464d45e24 Move over to a V2 data type, that will be much more flexible 2026-09-26 10:41:05 -04:00
FranckyB ce3be7999f Cleanup Thumbnail Generation code
Reduce quality and generation size slightly.
To reduce the json size and speed up generation
2026-09-26 01:11:13 -04:00
FranckyB 98139769c2 feat: add bulk snippet generation prompt and enhance prompt saving logic
- 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.
2026-09-25 09:16:50 -04:00
FranckyB 2b983e2bea feat: Enhance prompt management with export and import functionalities
- 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.
2026-09-24 22:46:16 -04:00
FranckyB f68f8f1201 feat: add anima family support with default sampler settings and rendering functionality 2026-09-24 02:55:19 -04:00
FranckyB 7ba9c464fb feat: enhance prompt renaming functionality with case-insensitive checks and improved error handling 2026-09-23 21:51:09 -04:00
FranckyB a01c6c3e0f feat: add prompt store adapters with utility functions and constants
- 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.
2026-09-23 02:44:31 -04:00
FranckyB a2ea2df2c5 feat: enhance prompt browser and composer functionality
- 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.
2026-09-21 11:35:44 -04:00
FranckyB ca447b6b62 feat: Add generation mode toggle for Prompt Composer and enhance Lora handling
- 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.
2026-09-21 00:47:41 -04:00
FranckyB 98d733faca feat(prompt_composer): add output format and compose position options
- 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.
2026-09-20 23:44:00 -04:00
FranckyB 0cf69cad19 feat: Add preference to hide downloadable built-in models in Prompt Manager 2026-09-13 23:33:25 -04:00
FranckyB b3ccc25cd7 Bump version to 2.7.2 and add system prompt storage format converter
- 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.
2026-08-23 17:05:32 -04:00
FranckyB 645f58da8e feat: Enhance prompt input handling and model management in Prompt Generator 2026-08-17 01:25:16 -04:00
FranckyB 1f09925d4f Add default system prompts for image and video generation models 2026-08-12 08:54:19 -04:00
FranckyB 0133804a7b feat: Implement centralized backup manager for prompt data files with rotating backups 2026-08-04 02:33:49 -04:00
Francois Beaudry a486506317 Merge pull request #44 from sophosympatheia/feat/gpu-device-selection
feat: Add GPU device selection for llama.cpp server (multi-GPU support)
2026-08-04 02:04:04 -04:00
sophosympatheia 4459c270c2 Fix mmproj discovery to recurse into subfolders and match same-folder files
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.
2026-08-03 21:21:43 -07:00
sophosympatheia fd707a2a05 Fix local model discovery to recurse into subfolders
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.
2026-08-03 21:15:08 -07:00
sophosympatheia 5411a0bf88 feat: Add GPU device selection for llama.cpp server (multi-GPU support)
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
2026-08-03 10:24:47 -07:00
FranckyB d9d49bc368 Seperated System Prompts as standalone prompt_generator.json, since we now have prompt browser to view and edit it. 2026-08-03 03:12:09 -04:00
FranckyB 52b72c9277 Refactor prompt management system
- 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.
2026-08-02 01:44:13 -04:00
FranckyB 4e8e47f8f4 Refactor Prompt Mixer to Prompt Composer
- 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.
2026-08-01 21:56:34 -04:00
FranckyB 229d7291ee feat: Implement Prompt Composer for building prompts from multiple parts
- 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.
2026-08-01 16:00:04 -04:00
FranckyB 99c05514da Refactor Prompt Mixer to Prompt Composer
- 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.
2026-08-01 12:51:49 -04:00
FranckyB db528293aa Implement code changes to enhance functionality and improve performance 2026-07-25 14:55:23 -04:00
FranckyB e00f57a5d0 feat: add Expression Selector extension for managing expressions in prompts
- 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.
2026-07-25 10:10:58 -04:00
FranckyB 67f12480ae feat: Enhance Prompt Manager with Multi-Slot LoRA Support
- 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.
2026-07-17 08:38:41 -04:00
FranckyB 070b9c2dfe refactor: Remove recipe_data output from PromptExtractor and enhance legacy metadata parsing functions 2026-05-31 02:08:05 -04:00
THE_BEAST\me 98c7d94290 refactor: Consolidate model preference handling by renaming and unifying preferred model settings 2026-05-17 03:48:22 -04:00
THE_BEAST\me ac7bb560a5 feat: Add video workflow extraction script and batch file for JSON output 2026-05-14 10:02:22 -04:00
THE_BEAST\me c3f7c85b9e refactor: Rename EXTRA key to EXTRA_1 and EXTRA_2 for clarity in recipe data handling 2026-04-30 07:35:31 -04:00
THE_BEAST\me ecf7472ff5 feat: Update version to 2.5.0 and add MultiLoraCombine class for enhanced LoRA stack management 2026-04-29 10:11:08 -04:00
THE_BEAST\meandCopilot c96badf1b9 feat: Implement prompt preset payload validation and enhance recipe data building from prompts
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 22:33:02 -04:00
THE_BEAST\meandCopilot c70894a020 feat: Improve recipe data handling by adding legacy support and normalization for v2 structure
Co-authored-by: Copilot <copilot@github.com>
2026-04-26 23:05:28 -04:00
THE_BEAST\meandCopilot 9ee1a0dd52 Refactor model handling and update placeholder strings
- 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>
2026-04-26 19:55:45 -04:00