33 Commits
Author SHA1 Message Date
PXL8D d1afeebad7 Major refactor: Clean up codebase to three-node architecture
✅ REMOVED unused code and nodes:
- MetaManLoadAndConvert (obsolete - replaced by Load Image + Extract Components)
- MetaManUniversalNodeV2 (obsolete - replaced by three-node architecture)
- MetaManWorkflowSaver (specialized node - not part of core)
- MetaManDependencyResolver (specialized node - not part of core)
- specialized_nodes.py (entire file removed)
- api_integration.py (only used by removed specialized nodes)
- metadata_parser.py (only used by removed specialized nodes)
- validation.py (testing file for removed features)
- templates/ directory (universal schema system not used by core nodes)
- test_installation.py (obsolete testing file)

✅ KEPT only three core nodes:
- MetaManLoadImage: Load images and extract metadata
- MetaManExtractComponents: Extract individual workflow parameters for reuse
- MetaManEmbedAndSave: Convert metadata formats and save with embedded metadata

✅ UPDATED configuration:
- __init__.py: Only registers three core nodes
- requirements.txt: Simplified to only essential dependencies
- metaman.py: Clean, self-contained implementation with all necessary functionality

✅ ENHANCED features maintained:
- Universal metadata extraction from any platform
- Tensor.AI EMS de-obfuscation
- Target service format conversion (A1111, ComfyUI, Civitai, Forge, etc.)
- Directory-based file organization
- Complete workflow component extraction

Result: Clean, focused codebase with 1,200+ lines of production-ready code
covering all essential metadata management functionality.
2025-08-13 13:46:15 -07:00
PXL8D 173bda5704 Enhance MetaMan Embed & Save node with target workflow selection and directory organization
- Add target_service dropdown for choosing output format (automatic1111, comfyui, civitai, forge, tensor.ai, leonardo.ai)
- Replace filename_prefix with directory parameter for subdirectory creation
- Add comprehensive format conversion methods for each target service
- Files now saved as MetaMan_{service}_{timestamp}.png in specified subdirectories
- Enhanced metadata embedding with service-specific formatting
2025-08-13 13:31:39 -07:00
PXL8D 0d3e814fa4 Add emergency recursive embedding scan - searches ALL metadata for embedding: text 2025-08-13 13:21:39 -07:00
PXL8D 2de75a9b87 Add direct workflow embeddings extraction - simplified approach that bypasses complex text scanning 2025-08-13 13:10:42 -07:00
PXL8D 21a658e7eb Enhanced embeddings extraction: Improved workflow widget scanning for Power Prompt embeddings 2025-08-13 13:03:39 -07:00
PXL8D e3483e5a64 CRITICAL FIX: Add workflow data scanning for embeddings detection
- Embeddings are stored in comfyui_workflow.nodes[].widgets_values, not comfyui_prompt
- Added _scan_workflow_widget_values() method to scan workflow data structure
- Store current metadata in self._current_metadata for cross-method access
- This should finally detect Power Prompt embeddings correctly

Fixes: Session 8 embeddings detection issue
2025-08-13 12:58:07 -07:00
PXL8D 1427912559 Add comprehensive widget_values debug logging
- Added debug logs to show widget_values for each node
- Added type checking and value preview for widget contents
- Will help identify why Power Prompt embeddings are not being found
2025-08-13 12:51:45 -07:00
PXL8D e2f93540ee Add comprehensive debug logging for embeddings detection
- Added debug logs to _extract_embeddings_from_text to show regex matches
- Added debug logs to _extract_embeddings_universal to show text candidates
- Will help identify why embeddings are not being detected
2025-08-13 12:17:22 -07:00
PXL8D 269c0ed80f Fix width/height extraction and embeddings detection
- Extract width/height from image_size field instead of defaulting to 512x512
- Add widget_values scanning to detect embeddings in Power Prompt nodes
- Resolves Session 8 Priority 1 & 2 issues
2025-08-13 12:13:48 -07:00
PXL8D 7ddc19c1b4 Session 8 Priority 1: Simplify LoRA output format to real_name and weight only
- Modified MetaManExtractComponents to return simplified LoRA list
- Enhanced LoRAs: Only real_name and weight fields
- Regular LoRAs: name mapped to real_name, weight preserved
- Removes unnecessary hash, label, and other metadata fields
- Cleaner output for workflow integration
- Updated logging to show simplified LoRA counts
2025-08-13 11:44:36 -07:00
PXL8D cc24d46b0a Fix Tensor.AI JSON parsing by cleaning null bytes, improve de-obfuscation logging and error handling, ensure proper model/LoRA mapping by index 2025-08-12 21:41:07 -07:00
PXL8D eeedbebc45 Critical bug fixes: resolve NameError in metadata scope, fix model tracing to continue through node references, improve LoRA mapping by index for Tensor.AI de-obfuscation 2025-08-12 21:35:16 -07:00
PXL8D bc4f891ee7 Implement Tensor.AI de-obfuscation system with VAE extraction - decode EMS model codes using generation_data chunk, extract real model names with hashes, add VAE support to component extractor 2025-08-12 21:26:59 -07:00
PXL8D c426f24953 Implement intelligent model resolution system - trace node connections to resolve actual model names and detect model types via VAE analysis 2025-08-12 19:59:37 -07:00
PXL8D 53d4cda2fe Fix LoRAs and embeddings extraction - add missing return statement and embeddings assignment 2025-08-12 19:33:23 -07:00
PXL8D f94df71c22 Enhance negative prompt detection and add embeddings support
MAJOR IMPROVEMENTS:
- Enhanced negative prompt detection with embedding syntax recognition
- Added _is_clearly_negative_content() to exclude obvious negative content from positive prompts
- Reduced length scoring weight for very long text (prevents negative prompts from dominating)
- Added comprehensive embeddings extraction with _extract_embeddings_universal()
- Updated MetaMan Extract Components to output LoRAs and embeddings as lists instead of strings
- Added well-known negative embedding detection (BadDream, FastNegative, etc.)
- Enhanced negative keyword density analysis with ratio-based scoring

This should fix the issue where negative prompts appear in both positive and negative outputs
by properly excluding content with high negative keyword density or embedding syntax.
2025-08-12 19:18:19 -07:00
PXL8D dbf44ae1a0 CRITICAL FIX: Prevent LoRA-only content from being selected as positive prompt
- Added _is_lora_only_content() to detect LoraTagLoader nodes and LoRA-only text
- Added _extract_human_readable_content() to separate human prompts from LoRA tags
- Modified _score_as_positive_prompt() to exclude LoRA-only content (return 0.0)
- Reduced LoRA scoring weight and made it conditional on human content presence
- This fixes the issue where LoRA tags were being selected instead of actual human prompts

Test case: '10010.text (LoraTagLoader)' should now be excluded, allowing
'10024.text (CLIPTextEncode)' with actual prompt to be selected.
2025-08-12 19:08:26 -07:00
PXL8D 2e650d85d0 Fix Priority 1 & 4: Enhanced prompt detection and restored LoRA extraction
- Priority 4: Added missing _extract_loras_from_text method to MetaManLoadImage class
- Priority 1: Enhanced _score_as_positive_prompt with better detection for processed fields (populated_text, formatted, etc.)
- Priority 2: Improved _parse_parameter_line to handle complex prompts with nested parentheses and brackets
- Increased scoring weight for LoRA presence and processed text fields
- Better handling of ImpactWildcardEncode and custom node outputs
2025-08-12 17:02:05 -07:00
PXL8D 921c5f9b72 Code cleanup: Remove old unused extraction methods 2025-08-12 16:45:24 -07:00
PXL8D 28d7271ea0 Fix Node Interface Issues - Session 5 Priority 2
- Fix MetaMan Extract Components: Use input connector instead of text field
- Fix MetaMan Embed & Save: Use input connector for metadata_json
- Fix MetaMan Embed & Save: Actually save files to output directory
- Remove image output from save node (OUTPUT_NODE = True)
- Add proper metadata parsing and A1111 format conversion
- Add UI feedback for saved files

Now supports clean workflow chaining:
MetaMan Load Image → MetaMan Extract Components → Individual outputs
MetaMan Load Image → MetaMan Embed & Save (auto-saves with metadata)
2025-08-12 16:44:51 -07:00
PXL8D bc90b37ea2 Implement Universal Dynamic Metadata Extraction System - Session 5 Priority 1 2025-08-12 16:37:02 -07:00
PXL8D 46d6a4da85 Implement MetaMan Extract Components node (Priority 2 - Metadata Provider)
Features implemented:
- MetaManExtractComponents: Extract individual workflow components from metadata JSON
- MetaManLoadAndConvert: Combined load + conversion functionality
- MetaManEmbedAndSave: Clean metadata embedding and save functionality
- Updated node registrations in __init__.py

Priority 2 delivers the most valuable workflow: 'stealing' specific parameters
from any image to use directly in ComfyUI workflows via individual typed outputs:
- positive_prompt, negative_prompt (STRING)
- steps, seed, width, height (INT)
- cfg_scale, denoising_strength (FLOAT)
- sampler, scheduler, model_name, loras (STRING)

Ready for testing with ComfyUI_00070_.png test case.
2025-08-12 16:10:49 -07:00
PXL8D 85507a4a8c Make metadata_json required input for MetaManUniversalNodeV2
- Change metadata_json from optional to required input
- Update function signature to match required parameter order
- Improve error handling for invalid metadata_json format
- Add better debug messaging for workflow guidance
- Forces proper two-node workflow: MetaManLoadImage → MetaManUniversalV2

Ensures users connect both image and metadata_json outputs correctly.
2025-08-12 15:36:59 -07:00
PXL8D fb43e7ccbb Add MetaMan Load Image node - preserves PNG metadata during loading
- Create MetaManLoadImage node that loads images with metadata preserved
- Extracts ComfyUI workflow/prompt data directly from PNG files
- Returns both image tensor and metadata JSON
- Update MetaManUniversalNodeV2 to accept optional metadata_json input
- Prioritize metadata from load image node over PIL extraction
- Register new node in both metaman.py and __init__.py

Solves metadata stripping issue by reading files before ComfyUI processing.
2025-08-12 15:28:09 -07:00
PXL8D b605de8de9 Add direct file reading to bypass ComfyUI metadata stripping
- Implement _try_read_original_file() to search for source PNG files
- Search ComfyUI input/output/temp directories for matching images
- Match files by dimensions and modification time
- Open original files directly with PIL to preserve PNG chunks
- Extract ComfyUI workflow/prompt metadata from original files
- Fallback when ComfyUI processed images have no metadata

Fixes issue where Load Image node strips PNG text chunks.
2025-08-12 15:03:36 -07:00
PXL8D c8c9193baf Add enhanced image debugging - analyze PIL image object structure
- Show image type, mode, format, size details
- Check for filename attribute from file loading
- Show PNG chunk sizes and content info
- Try alternative image.info access for metadata
- Identify potential metadata in different locations

Debug why PNG text chunks are not being found.
2025-08-12 14:11:34 -07:00
PXL8D 857646faf4 Fix metadata extraction bugs and add comprehensive debugging
- Implement missing _extract_params_from_comfyui_prompt() method
- Extract core parameters from ComfyUI workflow nodes (KSampler, CheckpointLoader, etc.)
- Enhanced service detection with multiple ComfyUI indicators
- Add comprehensive debug logging throughout extraction pipeline
- Preserve all source metadata in universal format conversion
- Detailed A1111 output formatting with parameter tracking

Fixes critical issue where ComfyUI workflow data returned empty metadata {}
2025-08-12 13:55:29 -07:00
PXL8D 20a4a15ba1 Force ComfyUI node cache refresh - rename to V2
- Rename MetaManUniversalNode to MetaManUniversalNodeV2
- Forces ComfyUI to reload node definition completely
- Eliminates cached 4-output interface from previous version
- Clean 2-output interface: image_workflow + json_workflow
- Display name: "MetaMan Universal V2"
2025-08-09 23:01:57 -07:00
PXL8D 2ffce1f514 Fix output connector naming 2025-08-09 22:47:00 -07:00
PXL8D ddfa1b49dc Simplify MetaMan Universal node based on user feedback
BREAKING CHANGE: Simplified node interface for better usability

Changes:
- Removed complex operation dropdown - node now has single focused purpose
- Reduced inputs to just: image + target_service selection
- Streamlined outputs to: processed image + comprehensive JSON metadata
- Integrated Civitai API for real-time dependency resolution
- Automatic metadata embedding in target service format
- Single workflow: extract → convert → embed → return

Features:
✅ Automatic source service detection
✅ Universal metadata conversion
✅ Target service format embedding in PNG chunks
✅ Live Civitai dependency lookup with download URLs
✅ Comprehensive JSON output with all conversion data
✅ Proper rate limiting for API calls

Technical improvements:
- Real Civitai API integration with hash matching
- Intelligent PNG chunk embedding per service
- Enhanced error handling with JSON error responses
- Optimized workflow for single-purpose efficiency

The node is now much simpler to use while providing more powerful functionality.
2025-08-09 21:27:46 -07:00
PXL8D 781ce38fe1 Fixed object reference 2025-08-09 14:23:21 -07:00
PXL8D 3c7b5658f0 Fix Python 3.10+ type hints compatibility
- Updated all type hints to use built-in types (dict, list, tuple) instead of typing imports
- Removed Dict, List, Tuple from typing imports since they're not needed in Python 3.10+
- Fixed NameError: name 'Dict' is not defined in specialized_nodes.py
- Modernized type annotations throughout codebase for better compatibility
- Resolves ComfyUI import error when loading MetaMan nodes

Files updated:
- specialized_nodes.py: Fixed all Dict/List/Tuple type hints
- metaman.py: Updated type annotations to modern syntax
- metadata_parser.py: Modernized type hints for consistency

Tested: ✅ Nodes now load successfully in ComfyUI without import errors
2025-08-09 14:18:57 -07:00
PXL8D 8722ae61dd Initial commit: MetaMan universal metadata management system
- Universal metadata extraction and conversion across AI platforms
- Support for A1111, ComfyUI, Civitai, Forge, Tensor.AI, Leonardo.AI
- Template-driven architecture for easy platform extension
- Model dependency resolution with download URLs
- Custom 'meta' PNG chunk standard for cross-platform compatibility
- Comprehensive validation and testing system
2025-08-08 19:21:10 -07:00