Commit Graph

701 Commits

Author SHA1 Message Date
Will Miao
c5b8e629fb Enhance save functionality in LoraModal for base model editing
- Added a check to prevent saving if the base model value has not changed.
- Stored the original value during editing to compare with the new selection.
- Updated the saveBaseModel function to accept the original value for comparison.
2025-03-26 07:05:32 +08:00
Will Miao
b0a495b4f6 Add base model editing functionality to LoraModal
- Introduced new styles for base model display and editing in lora-modal.css.
- Enhanced LoraModal.js to support editing of the base model with a dropdown selector.
- Implemented save functionality for the updated base model, including UI interactions for editing and saving changes.
2025-03-26 06:49:33 +08:00
Will Miao
7d2809467b Update tutorial video link 2025-03-25 14:10:13 +08:00
Will Miao
af90eeaf37 Bump version to 0.8.0 v0.8.0 2025-03-25 14:00:00 +08:00
AlUlkesh
509e513f3a Python < 3.11 backward compatibility for timeout. 2025-03-24 14:16:46 +01:00
pixelpaws
80671e474c Update README.md 2025-03-24 08:39:51 +08:00
pixelpaws
a166d859e7 Update README.md 2025-03-24 04:49:28 +08:00
Will Miao
6af1e0aeb7 Merge branch 'main' of https://github.com/willmiao/ComfyUI-Lora-Manager 2025-03-24 04:00:02 +08:00
Will Miao
370ffb5d7c Update discord invite 2025-03-24 03:59:44 +08:00
pixelpaws
0ba288d09e Update README.md 2025-03-24 03:49:17 +08:00
Will Miao
008d86983b Update workflow 2025-03-24 03:46:12 +08:00
Will Miao
205bdfce5c Update README.md with new features and enhancements for v0.8.0, including LoRA recipes, improved UI/UX, and workflow integration. Remove outdated screenshot and update Discord link in modals.html. 2025-03-23 16:53:46 +08:00
Will Miao
27248b197d Update cache management in ApiRoutes to remove hash index by file path
- Added functionality to update the hash index by removing entries associated with the specified file path during cache management.
- Ensured that the cache is properly resorted after the removal of raw data items.
2025-03-23 16:50:56 +08:00
Will Miao
e216b4c455 Refactor early access checks in recipe parsers
- Updated the early access condition checks in RecipeFormatParser, StandardMetadataParser, and A1111MetadataParser to use `get` method for improved readability and safety.
- Ensured consistent handling of early access status across different parser classes.
2025-03-23 15:29:47 +08:00
Will Miao
c402f53258 Implement early access handling and UI enhancements for LoRA downloads
- Added error handling for early access restrictions in the API routes, returning appropriate status codes and messages.
- Enhanced the Civitai client to log unauthorized access attempts and provide user-friendly error messages.
- Updated the download manager to check for early access requirements and log warnings accordingly.
- Introduced UI elements to indicate early access status for LoRAs, including badges and warning messages in the import manager.
- Improved toast notifications to inform users about early access download failures and provide relevant information.
2025-03-23 14:45:11 +08:00
Will Miao
93329abe8b Refactor LoraFileHandler to use provided event loop and improve logging
- Updated LoraFileHandler to utilize the passed event loop for time retrieval instead of the current thread's event loop.
- Changed error logging for extension loading in mappers from error to warning level for better clarity.
2025-03-23 09:22:57 +08:00
Will Miao
f69b3d96b6 Update dependencies in pyproject.toml and requirements.txt
- Added new dependencies: piexif, Pillow, and requests to enhance image processing and HTTP request capabilities.
- Ensured consistency between pyproject.toml and requirements.txt by including the same set of dependencies.
2025-03-23 08:48:13 +08:00
Will Miao
8690a8f11a Enhance LoraStackerMapper and WorkflowParser functionality
- Updated LoraStackerMapper to handle multiple formats for lora_stack input, improving flexibility in processing existing stacks.
- Introduced caching for processed node results in WorkflowParser to optimize performance and prevent redundant processing.
- Added a new method to collect loras from model inputs, enhancing the ability to extract relevant data from the workflow.
- Improved handling of processed nodes to avoid cycles and ensure accurate results during workflow parsing.
2025-03-23 07:41:55 +08:00
Will Miao
6aa2342be1 Enhance node processing and error handling in workflow mappers
- Improved reference handling in NodeMapper to support integer node IDs and added error logging for reference processing failures.
- Updated LoraLoaderMapper and LoraStackerMapper to handle lora_stack as a dictionary, ensuring compatibility with new data formats.
- Refactored trace_model_path utility to perform a depth-first search for LoRA nodes, improving the accuracy of model path tracing.
- Cleaned up unused code in parser.py related to LoRA processing, streamlining the workflow parsing logic.
2025-03-23 07:20:50 +08:00
Will Miao
042153329b Update dependencies 2025-03-23 05:42:00 +08:00
Will Miao
2b67091986 Enhance workflow parsing and node mapper registration
- Introduced a new WorkflowParser class to streamline workflow parsing and manage node mappers.
- Added functionality to load external mappers dynamically from a specified directory.
- Refactored LoraLoaderMapper and LoraStackerMapper to handle new data formats for loras and trigger words.
- Updated recipe routes to utilize the new WorkflowParser for parsing workflows.
- Made adjustments to the flux_prompt.json to reflect changes in active states and class types.
2025-03-23 05:21:43 +08:00
Will Miao
3da35cf0db Remove deprecated workflow parameters and associated files
- Deleted the `__init__.py`, `cli.py`, `extension_manager.py`, `integration_example.py`, `README.md`, `simple_test.py`, `test_parser.py`, `verify_workflow.py`, and `workflow_parser.py` files as they are no longer needed.
- Updated `.gitignore` to exclude new output files and test scripts.
- Cleaned up the node processors directory by removing all processor implementations and their registration logic.
2025-03-22 20:43:17 +08:00
Will Miao
e566484a17 Add Civitai URL retrieval functionality and UI integration
- Introduced a new API route to fetch the Civitai URL for a specified LoRA file.
- Implemented error handling for missing LoRA names and absence of Civitai data.
- Added a "View on Civitai" option in the UI, allowing users to access the Civitai URL directly from the LoRA widget.
- Enhanced user feedback for successful and failed URL retrieval attempts.
2025-03-22 17:35:30 +08:00
Will Miao
e7dffbbb1e Refactor LoRA handling in LoraLoader, LoraStacker, and TriggerWordToggle
- Introduced logging to track unexpected formats in LoRA and trigger word data.
- Refactored LoRA processing to support both old and new kwargs formats in LoraLoader and LoraStacker.
- Enhanced trigger word processing to handle different data formats in TriggerWordToggle.
- Improved code readability and maintainability by extracting common logic into helper methods.
2025-03-22 15:56:37 +08:00
Will Miao
a31712ad1f Wrap status badge in a container div for improved layout in ImportManager component 2025-03-22 10:24:01 +08:00
Will Miao
2958f81adc Revert "Refactor path mapping logic in Config class"
This reverts commit fce58f3206.
2025-03-22 10:18:26 +08:00
Will Miao
95380fbbfb Add base model mapping for SD 1.5 2025-03-22 09:49:35 +08:00
Will Miao
4cc6996406 Refactor theme toggle styles for improved positioning
- Updated CSS for the theme toggle component to ensure relative positioning for the container.
- Centered light and dark icons within the theme toggle using absolute positioning and transform properties.
- Added transition effects for opacity to enhance visual feedback during theme changes.
2025-03-22 09:49:15 +08:00
Will Miao
372d74ec71 Enhance settings management and localStorage integration
- Added functionality to load settings from localStorage in the SettingsManager, ensuring user preferences are retained across sessions.
- Updated the state management to initialize settings from localStorage, improving user experience.
- Refactored the UpdateService to streamline update notification preferences.
- Improved migration logic in storageHelpers to prevent duplicate migrations and ensure data integrity.
- Removed unnecessary console logs for cleaner output in various modules.
2025-03-22 08:46:36 +08:00
Will Miao
19ef73a07f Refactor storage handling across application
- Introduced a new storageHelpers module to centralize localStorage interactions, improving code maintainability and readability.
- Updated various components and managers to utilize the new storageHelpers functions for setting, getting, and removing items from localStorage.
- Added migration logic to handle localStorage items during application initialization, ensuring compatibility with the new storage structure.
- Enhanced logging during application initialization for better debugging.
2025-03-22 05:32:18 +08:00
Will Miao
bb3d73b87c Fix support modal width 2025-03-22 04:36:34 +08:00
Will Miao
30e9e7168f Update logging level for parsed workflow and add refresh button to recipe controls
- Changed logging from info to debug for parsed workflow in RecipeRoutes to reduce log verbosity.
- Added a refresh button in the recipe controls section of the HTML template to allow users to reload the recipe list easily.
2025-03-21 21:38:02 +08:00
Will Miao
fce58f3206 Refactor path mapping logic in Config class
- Updated add_path_mapping method to return a boolean indicating success or failure of mapping addition.
- Enhanced link scanning to only continue if a mapping was successfully added.
- Filtered paths to exclude those already mapped, improving efficiency in path handling.
- Added logging for existing mappings to provide better insights during execution.
2025-03-21 21:26:00 +08:00
Will Miao
b3e5ac395f Enhance recipe modal styles and tooltip functionality
- Updated CSS for recipe modal to improve layout and responsiveness, including adjustments to header and badge styles.
- Added tooltip positioning logic to ensure correct display of local-badge tooltips on hover.
- Refactored HTML structure for local status badges to enhance stability and positioning.
- Removed unnecessary console logs from recipe fetching process in JavaScript for cleaner output.
2025-03-21 20:19:58 +08:00
Will Miao
3ebe9d159a Refactor LoraRoutes to return empty recipes when no data is available
- Removed the logic for fetching and formatting recipes from the cache.
- Updated the response to return an empty list for recipes when no data is present, simplifying the flow.
- Adjusted comments for clarity regarding the new behavior.
2025-03-21 20:00:15 +08:00
pixelpaws
ff95274757 Merge pull request #45 from willmiao/dev
Dev
2025-03-21 17:31:42 +08:00
Will Miao
8e653e2173 Refactor recipe saving process to utilize workflow JSON and enhance Lora handling
- Updated the recipe saving logic to accept a workflow JSON input instead of individual fields like name, tags, and metadata.
- Implemented parsing of the workflow to extract generation parameters and Lora stack, improving the recipe creation process.
- Enhanced error handling for missing workflow data and invalid Lora formats.
- Removed deprecated code related to individual field handling, streamlining the recipe saving functionality.
- Updated the front-end widget to send the workflow JSON directly, simplifying the data preparation process.
2025-03-21 17:28:20 +08:00
Will Miao
4bff17aa1a Update prompt configuration and enhance Lora management functionality
- Expanded the prompt.json file with new configurations for KSampler, CheckpointLoaderSimple, and various CLIPTextEncode nodes.
- Introduced additional Lora management features, including a new Lora Stacker and improved trigger word handling.
- Enhanced the loras_widget.js to log the generated prompt when saving recipes directly, aiding in debugging and user feedback.
- Improved overall structure and organization of the prompt configurations for better maintainability.
2025-03-21 16:35:52 +08:00
Will Miao
d4f300645d Enhance ExifUtils to extract prompts from node references in workflows
- Updated the logic in ExifUtils to first identify KSampler nodes and store references to positive and negative prompt nodes.
- Added a helper function to follow these references and extract text content from CLIP Text Encode nodes.
- Implemented a fallback mechanism to extract prompts using traditional methods if references are not available.
- Improved code readability with additional comments and structured handling of node data.
2025-03-21 11:32:51 +08:00
Will Miao
4ee32f02c5 Add functionality to save recipes from the LoRAs widget
- Introduced a new API endpoint to save recipes directly from the LoRAs widget.
- Implemented logic to handle recipe data, including image processing and metadata extraction.
- Enhanced error handling for missing fields and image retrieval.
- Updated the ExifUtils to extract generation parameters from images for recipe creation.
- Added a direct save option in the widget, improving user experience.
2025-03-21 11:11:09 +08:00
Will Miao
2cf4440a1e Add Android icons and site.webmanifest for PWA support
- Added new Android icon images (192x192 and 512x512) for better app integration.
- Created site.webmanifest file to define app metadata and icon usage for Progressive Web App (PWA) functionality.
2025-03-21 05:37:58 +08:00
Will Miao
644ee31654 Remove site.webmanifest and refactor state initialization in RecipeManager and HeaderManager
- Deleted the site.webmanifest file as it is no longer needed.
- Simplified state management by removing initPageState from RecipeManager and integrating it into HeaderManager.
- Cleaned up console logging in loraApi.js to reduce unnecessary output.
- Minor formatting adjustments in FilterManager to enhance code readability.
2025-03-21 05:22:20 +08:00
Will Miao
34078d8a60 Refactor recipe card styles and update HTML structure
- Migrated CSS styles from recipe-card.css to card.css for better organization.
- Updated recipe card class names in HTML to align with new styling conventions.
- Enhanced card layout with additional flex properties for improved responsiveness.
- Adjusted infinite scroll debounce timing for better performance.
2025-03-20 21:42:17 +08:00
Will Miao
5cfae7198d Refactor recipe metadata handling and update CSS styles
- Moved the recipe metadata appending logic to occur after the JSON creation for better workflow.
- Adjusted the user comment formatting in ExifUtils to include a newline for improved readability.
- Reduced the maximum height of the recipe modal bottom section for better layout consistency.
2025-03-20 19:53:05 +08:00
Will Miao
6a10cda61f Add recipe metadata handling in image processing
- Implemented functionality to append recipe metadata to images during the recipe creation process.
- Removed redundant metadata handling from the temporary image processing step, streamlining the image handling logic.
- Enhanced the overall image processing workflow for better integration of recipe data.
2025-03-20 18:55:00 +08:00
Will Miao
c149e73ef7 Add recipe tags functionality to RecipeModal
- Implemented display of recipe tags in a compact format within the RecipeModal.
- Added tooltip for additional tags with hover functionality.
- Updated CSS styles for recipe tags and tooltips to enhance visual presentation.
- Adjusted layout and padding in related components for improved aesthetics.
2025-03-20 17:57:35 +08:00
Will Miao
b11757c913 Fix infinite scroll 2025-03-20 17:31:56 +08:00
Will Miao
607ab35cce Refactor search functionality in Lora and Recipe scanners to utilize fuzzy matching
- Introduced a new fuzzy_match utility function for improved search accuracy across Lora and Recipe scanners.
- Updated search logic in LoraScanner and RecipeScanner to leverage fuzzy matching for titles, tags, and filenames, enhancing user experience.
- Removed deprecated search methods to streamline the codebase and improve maintainability.
- Adjusted API routes to ensure compatibility with the new search options, including recursive search handling.
2025-03-20 16:55:51 +08:00
Will Miao
19ff2ebfe1 Refactor RecipeManager and ImportManager for improved functionality
- Removed deprecated global functions from RecipeManager to streamline the API and enhance clarity.
- Updated the import handling in ImportManager to directly call loadRecipes on the RecipeManager, ensuring better integration.
- Adjusted the recipes.html template to utilize the ImportManager for showing the import modal, improving code consistency.
2025-03-20 15:57:00 +08:00
Will Miao
4a47dc2073 Add new API routes for base models and update existing routes
- Introduced a new endpoint for retrieving base models used in loras, enhancing the API functionality.
- Updated the existing top-tags route to reflect the new URL structure under '/api/loras'.
- Modified the FilterManager to accommodate the new base models API, ensuring proper data fetching and display on the loras page.
- Improved error handling and logging for base model retrieval, enhancing overall robustness of the application.
2025-03-20 15:19:05 +08:00