Node Header Updates: - Add proper attribution headers to 10+ key nodes - Include original paper citations with BibTeX - Document dependencies and licenses for each algorithm - Fix corrupted docstring in advanced_film_grain_node.py New Documentation Files: - CONTRIBUTING.md: Complete contribution guidelines - Code of conduct and expectations - Development setup instructions - Code style guidelines and templates - Pull request process - License agreement terms - Attribution requirements - CITATION.cff: Machine-readable citation format - GitHub displays 'Cite this repository' button - Includes all major research papers implemented - Properly formatted for academic use - .zenodo.json: Zenodo/DOI integration - Enables automatic DOI assignment on release - Links to all related research papers - Documents dependencies and relationships - CONTRIBUTORS.md: Recognition of contributors - Credits all algorithm authors - Acknowledges third-party libraries - Template for future contributors - Special thanks section Updated Nodes: - DnCNN, SCUNet, SwinIR, NAFNet (AI models) - BM3D GPU (algorithm implementation) - Wavelet, NLM, Richardson-Lucy, Wiener (traditional) - Advanced Film Grain, Frequency Enhancement - DeepInv (external service integration)
9.8 KiB
Contributing to Eric's Image Processing Nodes
Thank you for your interest in contributing to this project! This document provides guidelines for contributing code, documentation, and other improvements.
Table of Contents
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Code Style Guidelines
- License Agreement
- Pull Request Process
- Attribution Requirements
Code of Conduct
Our Pledge
We are committed to providing a welcoming and inclusive environment for all contributors, regardless of experience level, gender identity, sexual orientation, disability, personal appearance, race, ethnicity, age, religion, or nationality.
Expected Behavior
- Be respectful and constructive in discussions
- Provide helpful feedback
- Focus on the code and ideas, not the person
- Be patient with newcomers
- Give credit where it's due
Unacceptable Behavior
- Harassment, discrimination, or offensive comments
- Trolling or deliberately inflammatory behavior
- Publishing others' private information without permission
- Any conduct that would be considered inappropriate in a professional setting
How Can I Contribute?
Reporting Bugs
Before submitting a bug report:
- Check the existing GitHub Issues
- Test with the latest version
- Ensure it's not a ComfyUI issue (try with vanilla ComfyUI)
When submitting a bug report, include:
- ComfyUI version
- Python version
- Operating system
- GPU/CUDA version (if using GPU features)
- Complete error message and traceback
- Minimal reproducible example
- Screenshots or workflow JSON if applicable
Suggesting Enhancements
We welcome suggestions for new features! Please include:
- Clear description of the feature
- Use case and motivation
- Example of how it would work
- Any relevant research papers or algorithms
- Whether you're willing to implement it yourself
Contributing Code
We welcome contributions of:
- New Nodes: Additional image processing algorithms
- Bug Fixes: Corrections to existing code
- Performance Improvements: Optimizations
- Documentation: Improvements to guides and examples
- Tests: Unit tests and integration tests
- Examples: Sample workflows and use cases
Development Setup
1. Fork and Clone
# Fork the repository on GitHub, then clone your fork:
git clone https://github.com/YOUR_USERNAME/Eric_Image_Processing_Nodes.git
cd Eric_Image_Processing_Nodes
2. Set Up Development Environment
# Create a virtual environment
python -m venv .venv
# Activate it
# Windows:
.venv\Scripts\activate
# Linux/Mac:
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install development dependencies
pip install pytest black flake8 mypy
3. Install Pre-commit Hooks (Optional but Recommended)
pip install pre-commit
pre-commit install
4. Link to ComfyUI
# Create a symlink in ComfyUI's custom_nodes directory
# Windows (run as administrator):
mklink /D "C:\path\to\ComfyUI\custom_nodes\Eric_Image_Processing_Nodes" "C:\path\to\your\clone"
# Linux/Mac:
ln -s /path/to/your/clone /path/to/ComfyUI/custom_nodes/Eric_Image_Processing_Nodes
Code Style Guidelines
Python Style
We follow PEP 8 with some modifications:
# Line length: 100 characters (not 79)
# Use 4 spaces for indentation (no tabs)
# Use double quotes for strings (unless single quotes avoid escaping)
File Header Template
All new node files must include a proper header:
"""
[Node Name] for ComfyUI
[Brief description]
Author: Eric Hiss (GitHub: EricRollei)
License: See LICENSE file in repository root
[If using external algorithm/model:]
Original Algorithm:
Paper: [Title]
Authors: [Authors]
Source: [URL]
License: [License]
Citation:
@[type]{[key],
title={[Title]},
author={[Authors]},
year={[Year]}
}
Dependencies:
- Library (License)
- Library (License)
"""
Node Structure
Follow the established pattern:
class YourNode(BaseImageProcessingNode):
"""
Detailed docstring explaining:
- What the node does
- When to use it
- Key parameters
- Typical use cases
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"image": ("IMAGE",),
# ... other inputs
}
}
RETURN_TYPES = ("IMAGE",)
RETURN_NAMES = ("processed_image",)
FUNCTION = "process"
CATEGORY = "Eric's Image Processing/Your Category"
def process(self, image, **kwargs):
# Process logic here
pass
Processing Script Structure
Keep processing logic separate from node code:
# scripts/your_algorithm.py
"""
Pure processing functions (no ComfyUI dependencies)
Can be tested standalone
"""
def your_algorithm(image_np: np.ndarray, **params) -> np.ndarray:
"""
Process image with your algorithm.
Args:
image_np: Input image as numpy array [H, W, C] with values 0-255
**params: Algorithm parameters
Returns:
Processed image as numpy array [H, W, C] with values 0-255
"""
# Ensure contiguous array for OpenCV compatibility
image_np = np.ascontiguousarray(image_np)
# Your processing logic
# Ensure output is contiguous
result = np.ascontiguousarray(result)
return result
Testing
Add tests for new functionality:
# tests/test_your_node.py
import pytest
import numpy as np
from scripts.your_algorithm import your_algorithm
def test_your_algorithm_basic():
"""Test basic functionality"""
image = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
result = your_algorithm(image)
assert result.shape == image.shape
assert result.dtype == np.uint8
def test_your_algorithm_edge_cases():
"""Test edge cases"""
# Test with all black
black = np.zeros((100, 100, 3), dtype=np.uint8)
result = your_algorithm(black)
assert result is not None
License Agreement
By Contributing, You Agree That:
-
Your contributions will be licensed under the same dual license as the project:
- Non-commercial: CC BY-NC 4.0
- Commercial: Separate license required (contact eric@historic.camera)
-
You have the right to contribute the code (it's your original work or you have permission)
-
You will provide proper attribution for any:
- External algorithms or models used
- Research papers implemented
- Third-party code adapted
- Dependencies added
-
You grant the project maintainer (Eric Hiss) the right to:
- Include your contribution in the project
- Modify your contribution as needed
- Relicense your contribution if the project license changes
For Significant Contributions
For major contributions (new models, significant features), please:
- Add your name to the CONTRIBUTORS list
- Include your email for attribution (optional)
- Document your contribution in the commit message
Pull Request Process
1. Create a Branch
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description
2. Make Your Changes
- Follow the code style guidelines
- Add proper headers to new files
- Update documentation as needed
- Add tests for new functionality
- Ensure all tests pass
3. Commit Your Changes
Use clear, descriptive commit messages:
git commit -m "Add [Feature]: Brief description
- Detailed point 1
- Detailed point 2
- References #issue-number if applicable"
4. Push to Your Fork
git push origin feature/your-feature-name
5. Submit Pull Request
On GitHub:
- Go to your fork
- Click "New Pull Request"
- Select your branch
- Fill out the PR template:
- Description of changes
- Motivation and context
- Testing performed
- Screenshots if UI changes
- Checklist items completed
6. Code Review
- Respond to review comments
- Make requested changes
- Update the PR
- Be patient and respectful
7. Merge
Once approved, the maintainer will merge your PR. Thank you! 🎉
Attribution Requirements
When Adding External Algorithms
You must include:
- Original paper citation in docstring
- Source repository link if applicable
- License information of the original work
- Author credits
- Link to pretrained weights if used
When Adding Dependencies
Update these files:
requirements.txt- Add the dependencyLICENSE- Add dependency license infoDocs/MODEL_WEIGHTS.md- If models are involved- File header - List new dependencies
Example Attribution
"""
Original Algorithm:
Paper: "Algorithm Name"
Authors: Smith et al., Conference 2023
Source: https://github.com/author/repo
License: MIT License
Pretrained weights: https://github.com/author/repo/releases
Citation:
@inproceedings{smith2023algorithm,
title={Algorithm Name},
author={Smith, John and Doe, Jane},
booktitle={Conference},
year={2023}
}
Implementation Notes:
[Your modifications or adaptations]
Contributed by: [Your Name] (GitHub: @yourusername)
Date: [Month Year]
"""
Questions?
- Issues: Use GitHub Issues for questions
- Discussions: Use GitHub Discussions for general discussions
- Email: For private matters, contact eric@historic.camera
Recognition
Contributors will be acknowledged in:
- The CONTRIBUTORS file
- Release notes
- Documentation credits section
Thank you for contributing! Your work helps the ComfyUI community! 🚀