- Implement basic 3D model thumbnail rendering with fallback icon - Update viewer mode selection logic to handle 3D models - Add checks for 3D model interactions in the viewer - Extend drag & drop support to include 3D model assets
3.5 KiB
Majoor Assets Manager - Plugin Examples
This directory contains example metadata extractor plugins for the Majoor Assets Manager.
Available Examples
1. WanVideo Extractor (wanvideo_extractor.py)
Extracts WanVideo custom node metadata from PNG/WebP files.
Features:
- Reads WanVideo-specific PNG chunks
- Extracts motion bucket ID, FPS, augmentation level
- Falls back to standard ComfyUI metadata
Priority: 100 (high - runs before generic extractors)
2. rgthree Extractor (rgthree_extractor.py)
Extracts rgthree custom node metadata.
Features:
- Reads rgthree-specific workflow data
- Extracts comparison image references
- Parses context mappings
Priority: 50 (medium)
3. Custom Node Extractor Template (custom_node_extractor.py)
Template for creating custom extractors for any custom node.
Features:
- Well-documented template
- Shows all available hooks
- Includes error handling patterns
Priority: Configurable
Installation
Option 1: Copy to Global Plugin Directory
# Windows (PowerShell)
Copy-Item wanvideo_extractor.py ~/.comfyui/majoor_plugins/extractors/
# Linux/macOS
cp wanvideo_extractor.py ~/.comfyui/majoor_plugins/extractors/
Option 2: Copy to Local Plugin Directory
# Copy to ComfyUI output directory
cp wanvideo_extractor.py <ComfyUI>/output/_mjr_plugins/extractors/
Option 3: Use Bundled Plugins Directory
# Copy to extension's plugins directory
cp wanvideo_extractor.py <ComfyUI>/custom_nodes/ComfyUI-Majoor-AssetsManager/plugins/
Usage
After installing plugins:
-
Restart ComfyUI or reload plugins via API:
curl -X POST http://localhost:8188/mjr/am/plugins/reload -
List installed plugins:
curl http://localhost:8188/mjr/am/plugins/list -
Enable/Disable plugins via Assets Manager UI:
- Open Settings → Plugins tab
- Toggle plugins on/off
Creating Your Own Plugin
See custom_node_extractor.py for a complete template with documentation.
Quick Start
from mjr_am_backend.features.metadata.plugin_system.base import (
MetadataExtractorPlugin,
ExtractionResult,
)
class MyExtractor(MetadataExtractorPlugin):
@property
def name(self): return "my_extractor"
@property
def supported_extensions(self): return ['.png']
@property
def priority(self): return 50
async def extract(self, filepath: str) -> ExtractionResult:
# Your extraction logic here
data = {"key": "value"}
return self._create_success_result(data)
Troubleshooting
Plugin Not Loading
- Check logs for validation errors
- Verify file is in correct directory
- Ensure plugin inherits from
MetadataExtractorPlugin - Check for syntax errors
Extraction Fails
- Enable debug logging:
MJR_PLUGIN_LOG_LEVEL=DEBUG - Check file permissions
- Verify file format is supported
Performance Issues
- Reduce plugin priority to run later
- Implement caching in plugin
- Use
pre_extract()for quick rejections
Security Notes
Plugins are validated before loading. The following are blocked:
eval()/exec()usageos.system()/subprocesscalls- Network access (socket, requests)
- Unsafe deserialization (pickle, marshal)
See PLUGIN_SYSTEM_DESIGN.md for complete security model.
License
All example plugins are provided under the MIT license.
For complete documentation, see:
docs/PLUGIN_SYSTEM_DESIGN.md- Architecture and designdocs/PLUGIN_DEVELOPMENT_GUIDE.md- Development guide (TODO: create)