diff --git a/README.md b/README.md index 79af3ea..9eb3ed1 100644 --- a/README.md +++ b/README.md @@ -824,6 +824,14 @@ MIT License - see LICENSE file for details. ## Changelog +### v3.0.24 (Manual Prompt Creation) + +- **➕ Add Prompt Button**: New "Add Prompt" button in the admin dashboard Bulk Actions bar +- **📝 Direct Prompt Creation**: Create prompts directly from the UI without generating images +- **🛡️ Protection from Pruning**: New prompts are automatically protected from orphan cleanup by default +- **🏷️ Full Metadata Support**: Set category, tags, rating, and notes when creating prompts +- **🔒 Orphan Protection Toggle**: Option to protect or unprotect prompts from maintenance cleanup + ### v3.0.23 (AI AutoTag Release) - **🏷️ AI AutoTag**: Automatically tag your entire image collection using JoyCaption vision models diff --git a/py/api.py b/py/api.py index 2df1515..e0e10f7 100644 --- a/py/api.py +++ b/py/api.py @@ -3205,15 +3205,19 @@ class PromptManagerAPI: } # Prune orphaned prompts (prompts with no linked images) + # Note: Prompts with the __protected__ tag are excluded from orphan cleanup + # This allows users to add prompts manually without images that won't be deleted if 'prune_orphaned_prompts' in operations: try: with self.db.model.get_connection() as conn: # Find prompts that have no images linked to them + # Exclude prompts with the __protected__ tag cursor = conn.execute(""" - SELECT p.id - FROM prompts p - LEFT JOIN generated_images gi ON p.id = gi.prompt_id + SELECT p.id + FROM prompts p + LEFT JOIN generated_images gi ON p.id = gi.prompt_id WHERE gi.prompt_id IS NULL + AND (p.tags IS NULL OR p.tags NOT LIKE '%"__protected__"%') """) orphaned_prompts = cursor.fetchall() orphaned_count = len(orphaned_prompts) @@ -3231,7 +3235,7 @@ class PromptManagerAPI: results['prune_orphaned_prompts'] = { 'success': True, 'removed_count': removed_count, - 'message': f'Removed {removed_count} orphaned prompts (prompts with no linked images)' + 'message': f'Removed {removed_count} orphaned prompts (prompts with no linked images, excluding protected prompts)' } except Exception as e: results['prune_orphaned_prompts'] = { diff --git a/pyproject.toml b/pyproject.toml index b71a258..bebcd9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "promptmanager" description = "A powerful ComfyUI custom node that extends the standard text encoder with persistent prompt storage, advanced search capabilities, and an automatic image gallery system using SQLite." -version = "3.0.23" +version = "3.0.24" license = {file = "LICENSE"} dependencies = ["# Core dependencies for PromptManager", "# Note: Most dependencies are already included with ComfyUI", "# Already included with Python standard library:", "# - sqlite3", "# - hashlib", "# - json", "# - datetime", "# - os", "# - typing", "# - threading", "# - uuid", "# Required for gallery functionality:", "watchdog>=2.1.0 # For file system monitoring", "Pillow>=8.0.0 # For image metadata extraction (usually included with ComfyUI)", "# Optional dependencies for enhanced search functionality:", "# fuzzywuzzy[speedup]>=0.18.0 # For fuzzy string matching (optional)", "# sqlalchemy>=1.4.0 # For advanced ORM features (optional)", "# Development dependencies (optional):", "# pytest>=6.0.0 # For running tests", "# black>=22.0.0 # For code formatting", "# flake8>=4.0.0 # For linting", "# mypy>=0.910 # For type checking"] diff --git a/web/admin.html b/web/admin.html index dc199a2..59fe9a6 100644 --- a/web/admin.html +++ b/web/admin.html @@ -204,11 +204,15 @@ class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 disabled:bg-gray-600 disabled:cursor-not-allowed text-white text-sm font-medium rounded-lg transition-colors"> 🏷️ Add Tags - - + @@ -823,6 +827,101 @@ + +
+ @@ -780,6 +784,101 @@ No sentences, no commentary, no captions. Only tags. Keep length short but descr + + +